我想通过单击按钮构建对 db 的查询,从 texboxes 获取参数。有这样的类定义:
DEFINE CLASS myForm as Form
Height = 200
Width = 300
visible = .t.
ADD OBJECT insertBut AS COMMANDBUTTON;
WITH Caption = "insert", width = 70, height = 20, top = 165, left = 10
ADD OBJECT lbl1 as label WITH caption = 'Title', left = 10, top = 10
ADD OBJECT text1 AS TEXTBOX WITH left = 10, top = 25
ADD OBJECT lbl2 as label WITH caption = 'Amount', left = 10, top = 45
ADD OBJECT text2 as textbox WITH left = 10, top = 60
ADD OBJECT lbl3 as label WITH caption = 'Price', left = 10, top = 80
ADD OBJECT text3 as textbox WITH left = 10, top = 95
ADD OBJECT lbl4 as label WITH caption = 'Manufacturer id', left = 10, top = 115
ADD OBJECT text4 as textbox WITH left = 10, top = 130
ADD OBJECT lbl5 as label WITH caption = 'Id', left = 120, top = 10
ADD OBJECT text5 as textbox WITH left = 120, top = 25
PROCEDURE insertBut.click
USE stock
INSERT INTO stock (title, price, amount, man_id) values(text1.text, text3.text, text2.text, text4.text)
browse
ENDPROC
ENDDEFINE
和我通过命令行调用的程序
PROCEDURE tform
t = CREATEOBJECT("myform")
t.show
READ events
return
ENDPROC
单击按钮插入后,但出现错误“未找到别名 TEXT1”。我究竟做错了什么?