Setting form variables and calling form procedures from the creator of the form…

Knowledge Base Article # Q200066

Read Prior Article Read Next Article
Summary Setting form variables and calling form procedures from the creator of the form before the form is displayed
  
Login to rate article
Solution:

  • For a modeless form (Load frmVariable, FALSE):
1. Use frmVariable.variableName where the variableName is a form’s public variable.

2. Use a form procedure to set or get the variable’s value.  For example:

frmVariable.SetVariableValue(value)
frmVariable.GetVariableValue():type.  Note:  procedure must be public.
  • For a modal form (Load frm.Variable, TRUE):
The caller cannot set the variable or call a procedure because the control does not return to the Load’s callee until the form is destroyed.

1. You can use a Module (program, system or driver) Procedure or a variable to retrieve a value and use it in the OnLoad Form Event.

2. You can create the form as modeless (as shown above), set the form’s variables, call the form's procedure and use the Load statement again with TRUE as the mode parameter.  See the example below:

Load frmVariable, FALSE
frmVariable.variableName=value
frmVariable.procName()
Load frmVariable, TRUE


Note:  This procedure can only be implemented in ATEasy 4.0 (build 94) or ATEasy 5.0 (build 102b and above).  You can initialize the form to be hidden and then show it just before the second Load statement (frmVariable.Visible=True).  See the example below:

Load frmVariable, FALSE
frmVariable.variableName=value
frmVariable.Visible=True
Load frmVariable, TRUE


This added line (line 3) will prevent the user from accessing the form control before the form is ready.
Article Date 9/1/2005
Keywords ATEasy, AForm, Load, Modal, Modeless


Login to rate article

1 ratings | 5 out of 5
Read Prior Article Read Next Article