public oMyform
oMyform=createobject("form1")
oMyform.visible=.T.
define class form1 as form
caption="为方法和事件传递参数实例"
name="form1"
add object command1 as commandbutton with;
top=100,;
left=100,;
width=100,;
height=25,;
caption="单击我"
*!*使用laprameters声明参数
procedure mousemove
lparameters nbutton,nShift,nxcoord,nycoord
wait window"鼠标坐标"+str(nxcoord)+"|"+str(nycoord) nowait
endproc
*|*使用内联方法声明参数
procedure myproc
PARAMETERS cText, nNumber
if PARAMETERS()=2
* messagebox("接到的参数:ctext"+cText+"nNumber="+alltrim(str(nNumber))
messagebox("接到的参数:ctext"+cText+"nNumber="+alltrim(str(nNumber)))
endif
endproc
procedure command1.click
thisform.myproc("春天",2)
endproc
enddefine