Using the Form

In this example, load the form within a new test you will create in MyProgram. You will also create a variable that will have MyForm as a type.

To use the form:

1.      Define the form variable. Insert a new variable under the MyProgram variables submodule. Rename it to frmMyForm. Set its type to be MyForm as shown here:

 

2.      Insert a new Task in MyProgram. Name the task Forms and the test as MyForm.

3.      In the MyForm test code view, type the following lines of code:

! creates the form in modal mode

Load frmMyForm, TRUE

! deletes the form object

frmMyForm=Nothing

The first statement loads the form in modal mode and uses the windows desktop as a parent. The second statement deletes the form object releasing all resources associated with the object. This statement will be executed after the form window is destroyed. Note that before destroying the form object, you can still use form public variables and procedures (for example, frmMyForm.m_iAcquire if it was declared as public).