读书笔记《VFP6.0-9.0解决方案与范例大全》一[表单之间参数的传递与返回]
表单之间参数的传递与返回 在VFP中,表单之间参数的传递与返回主要通过Do Form命令实现 假设现在有表单test1和test2,分别表示调用表单和被调用表单,要实现参数的传递和返回,必须进行如下设置:
Lparameters lcstr this.text1.value=lcstr this.lcstr=lcstr cmdset按钮的click事件代码如下(用于修改传递参数,设置返回值): thisform.lcstr=thisform.text1.value frmtest2表单的unload事件代码如下(用于返回数据): return thisform.lcstr
cmdset按纽的click事件代码(用于参数的传递与返回): local lcstr do form test2 to lcstr with thisform.text1.value &&(lcstr=>返回的参数 thisform.text1.value=>传递的参数) thisform.caption=lcstr |
|