简单写几句,不知是不是这意思。
** test.prg
CREATE CURSOR 成绩表 (课程号 I, 成绩 N(6,1))
INSERT INTO 成绩表 VALUES (1, 101.0)
INSERT INTO 成绩表 VALUES (2, 102.0)
INSERT INTO 成绩表 VALUES (3, 103.0)
CREATE CURSOR 课程表 (课程号 I, 课程名 C(10))
INSERT INTO 课程表 VALUES (1, "数学")
INSERT INTO 课程表 VALUES (2, "物理")
INSERT INTO 课程表 VALUES (3, "化学")
INDEX on 课程号 TAG 课程号
SELECT 成绩表
SET RELATION TO 课程号 INTO "课程表"
GO TOP
of = CREATEOBJECT("myForm")
of.show
READ EVENTS
SET RELATION TO
RETURN
DEFINE CLASS myForm as Form
ADD OBJECT grid1 as myGrid
PROCEDURE unload
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS myGrid as grid
RecordSource="成绩表"
ColumnCount=2
PROCEDURE init
this.Column1.ControlSource="成绩表.课程号"
this.Column2.ControlSource="课程表.课程名"
ENDPROC
ENDDEFINE
** test.prg
CREATE CURSOR 成绩表 (课程号 I, 成绩 N(6,1))
INSERT INTO 成绩表 VALUES (1, 101.0)
INSERT INTO 成绩表 VALUES (2, 102.0)
INSERT INTO 成绩表 VALUES (3, 103.0)
CREATE CURSOR 课程表 (课程号 I, 课程名 C(10))
INSERT INTO 课程表 VALUES (1, "数学")
INSERT INTO 课程表 VALUES (2, "物理")
INSERT INTO 课程表 VALUES (3, "化学")
INDEX on 课程号 TAG 课程号
SELECT 成绩表
SET RELATION TO 课程号 INTO "课程表"
GO TOP
of = CREATEOBJECT("myForm")
of.show
READ EVENTS
SET RELATION TO
RETURN
DEFINE CLASS myForm as Form
ADD OBJECT grid1 as myGrid
PROCEDURE unload
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS myGrid as grid
RecordSource="成绩表"
ColumnCount=2
PROCEDURE init
this.Column1.ControlSource="成绩表.课程号"
this.Column2.ControlSource="课程表.课程名"
ENDPROC
ENDDEFINE