pause
STATE

The pause statement temporarily pauses a procedure.


Parameters

This statement has one parameter:

state – is ignored. In previous versions of Panorama, this parameter was required to be a global variable that stored the state of the procedure at the time the procedure was paused. Now, however, Panorama stores this state internally. The parameter has been retained to maintain compatibility with existing databases, however, the parameter is now ignored. You can use any legal formula for this parameter (we recommend "").


Description

This statement temporarily pauses a procedure. Later the procedure can be started up again from this point. For example you might want to pause a procedure while the user fills in a dialog, then continue when the user presses the Ok button.

The example opens a form called Sound & Video. To the user, this form will appear to be a standard dialog box. Once the dialog box is open the procedure will pause, allowing the user to type values into the box, select checkboxes, etc.

setwindow 100,100,300,400,""
opendialog "Sound & Video"
pause ""
// pause here for user to fill in dialog
closewindow
if info("trigger") contains "Ok" or info("trigger")="Key.Enter"
    beep
endif

If you want a button in the Sound & Video dialog to close the dialog, that button should be linked to a procedure that contains the following statement:

resume ""

The resume statement causes the original procedure to continue, starting from right after the pause statement. In this case the procedure closes the dialog and plays a sound if the user pressed Ok. The advantage of using the pause and resume statements is that a single dialog form may be used with many procedures. The buttons in the dialog aren’t actually linked to any specific procedure, they simply let whatever procedure opened the dialog in the first place continue.

Note: It is possible (and often useful) to nest pause & resume statements. In other words a procedure can pause, then a button or other action can start a second procedure, which then also pauses. The resume statement will then resume the second procedure. A second resume statement will resume the first procedure. Of course the pause and resume statements must be matched – each pause must have a corresponding resume.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but the parameter can now simply be "" (it will still accept a variable name as well).