Pass Parameters Between Forms Sample
File: ...\Samples\Solution\Forms\Param.scx
This solution illustrates passing parameters to a form and returning a value back.
PARAM Form
This form has the user enter a question and possible responses. Then, in the Click event of the cmdAsk button, the ParamAsk form is opened by passing the Question and Possible responses.
cParam1 = THISFORM.txtPassValue1.value
nParam2 = THISFORM.opgPassValue2.value
DO FORM LOCFILE("ParamAsk.scx") WITH cParam1, nParam2 TO nRetValue
PARAMASK Form
The PARAMETERS are passed to the Init of the form where they are processed.
PARAMETERS cQuestion, nButtons
THISFORM.txtQuestion.caption = cQuestion
In the Unload event of the form, the value stored in retvalue is returned back to the calling form:
RETURN THISFORM.retValue
See Also
Tasks
Reference
Visual FoxPro Foundation Classes A-Z