Pass Parameters Between Forms Sample

File: ...\Samples\Solution\Forms\Param.scx

This solution illustrates passing parameters to a form and returning a value back.


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.

 CopyCode imageCopy Code
cParam1 = THISFORM.txtPassValue1.value
nParam2 = THISFORM.opgPassValue2.value
DO FORM LOCFILE("ParamAsk.scx") WITH cParam1, nParam2 TO nRetValue


The PARAMETERS are passed to the Init of the form where they are processed.

 CopyCode imageCopy Code
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:

 CopyCode imageCopy Code

See Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic