formModalExFmt.vrf.annotated

#

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

BEGSR formModalExFmt Activate
#

Assign this form's textbox value from the global variable.

    textboxCustomerName.Text = Global_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
#

Hide this form--it stays in memory and its state persists.

BEGSR buttonHide Click
    Hide *This
ENDSR
#

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

BEGSR buttonUnload Click
    Unload *This
ENDSR
#

This event fires when immediately when this form is no longer the active form.

BEGSR formModalExFmt Deactivate
#

On form deactivation (the instant it is no longer the active form) assign its textbox's value to the global variable.

    Global_CustomerName = textboxCustomerName.Text 
ENDSR