You are here: Surpac Concepts > Macros > SCL > System and Misc > SclRun
GEOVIA Surpac

SclRun

Overview

Display a GuidoForm object that has previously been created by the SclCreateGuidoForm command and wait until the user has finished with it by pressing a button on the Guido form.

GuidoForm Objects used in Scl scripts may include:

  • fields
  • text labels
  • radio buttons
  • button groups
  • check-boxes
  • combo-boxes
  • tables (for entering multiple rows of data for a field)
  • etc.

The Guidoform object that is created by the SclCreateGuidoForm command only creates the object. The SclRun command is used to display the Guidoform object and to define the body of code that is used to retrieve and operate on the values entered by the user on the form.

Synopsis

$GuidoFormHandle SclRun Body

Description

Execute the GuidoForm associated with the GuidoFormHandle variable. During execution of the GuidoForm the user maintains interactive control until the GuidoForm object is dismissed by pressing a button. The code to retrieve and operate on values may be defined within the body of the SclRun command.

A number of examples exist to show how the SclCreateGuidoForm and SclRun commands are used.

Arguments

  • GuidoForm
  • Passed by value. This is the handle to the GuidoForm object that has previously been created by the SclCreateGuidoForm command.

  • Body
  • The body of the SclRun command is used to define the code that is executed immediately after a button is pressed by the user causing the form to be dismissed. The SclRun command creates a Tcl variable for each GuidoComponent in the GuidoForm. Scalar variables (single value variables) are created for each Guido component that exists outside a table while Tcl array variables are created for each Guido component that exists in a GuidoTable. Each of these Tcl variables that is created has a name that is identical to the name of the Guido component that it represents in the GuidoForm.

    A variable with the name _status is created and it is assigned a character string that represents the button that was pressed to dismiss the form. For example, if the Apply button is pressed then this variable is assigned the value apply, while if the Cancel button is pressed this variable is assigned the value cancel.

    The _status variable can therefore be tested and appropriate action taken according to the button that has been pressed.

    Note that the variables that represent the user entered values ARE NOT created if the Cancel button is pressed.

Examples can be found here

See Also

Guido
SclCreateGuidoForm
SclDestroy