formModalCall.vrf.annotated

#

Declare the entry point and parameter list for this called program.

DclPList *Entry
#

A *String type can't be as a parameter type in a parameter list.

DclParm CustomerName Type(*Char) Len(40) 

DclFld Counter Type(*Integer) Len(4)
#

This event handler fires when this form becomes the active form.

BEGSR formModalCall Activate
#

Assign this form's textbox value from the call/parm parameter. Because this fixed-length field probably has trailing blanks, trim it first.

    textboxCustomerName.Text =  %TRIM(CustomerName)
#

Increment the counter to help illustrate how state can be persisted for a form.

    Counter = Counter + 1
    labelTimesCalled.Caption = 'Times shown' + %CHAR(%EDITC(Counter, '1')) 
ENDSR
#

When a CALLed form is hidden, it does NOT stay in memory. For CALLed forms the Hide opcode does exactly the same thing as the Unload opcode.

#

While Hide or Unload can be used to return from a CALled program, give the potential confusion that Hide could cause in this case, it's probably best to always return from CALLed forms with the Return opcode.

BEGSR buttonHide Click
    CustomerName = textboxCustomerName.Text
#

Hide *This

    Return 
ENDSR
#

Unload this form from memory--its state doesn't persist.

BEGSR buttonUnLoad Click
    CustomerName = textboxCustomerName.Text
#

Unload *This

    Return 
ENDSR