3.4 PROCEDURE-ORIENTED TCL COMMANDS

This section describes the TCL commands designed to be used in PDFs.

3.4.1 General Rules

The following rules apply to the commands described in this section:

  1. Command qualifiers are not permitted in the commands listed in this section.

  2. Any command may be preceded by a label.

  3. Arbitrary nestings--loops within loops, IF/ELSE within loops, or other IF/ELSE's--are permitted. The allowed depth of nesting is host-dependent.

  4. Any command may contain variable substitution indicators. Variable substitution is described in Section 3.3.2.8.

  5. Commands that use proc invocation form may specify parameters positionally or by using the parameter names (i.e., "name=value" form).(See the "TAE Command Language (TCL) User's Manual" for a description of how parameters are specified in a proc invocation.)

  6. The rules for the abbreviation of names and string values in TCL procedure-oriented commands are the same as those for TCL user-oriented commands. See the "TAE Command Language (TCL) User's Manual."

  7. For most of the commands shown, TM does not execute the _ONFAIL(1) command upon command failure. If TM does use the _ONFAIL(1) command, the "Usage Notes" section includes an appropriate note. (See Section 3.5 for a description of ONFAIL and error handling facilities.)

3.4.2 Command Descriptions

The format of the command descriptions below is:

  1. The first line below the title gives a one line description of the purpose of the command.
  2. The "Format" gives a template for using the command. For commands using proc invocation form, parameter names are always shown, however, the parameter values in all cases may be specified positionally.

    Words in uppercase in the format are the command name, parameter names, or other keywords (e.g. "ELSE"), and are to be typed as shown (not necessarily in uppercase, however).

  3. The "Parameters" section describes each of the parameters named in the format section. The order of the parameter descriptions is the order in which the parameters must be specified if given by position.

    In cases where the form of the command is not "proc invocation form," that is, when the form is not "PROC P1=A P2=B ..." the "Parameters" section is omitted.

    Parameter values shown in the format section in uppercase are literals and must be typed as shown; values in lowercase indicate the type or use of the value.

  4. The "Usage Notes" section describes the rules for using the command.
  5. The "Examples" section is omitted if the command's usage is obvious.

3.4.2.1 BODY - Introduce the Procedure Body

BODY signals the start of the procedure body.

FORMAT

BODY

PARAMETERS

None

USAGE NOTES

  1. BODY terminates the declaration section of the procedure.

  2. BODY is permitted only in a procedure.

EXAMPLES

See examples in Section 2.1.2.

3.4.2.2 BREAK - Loop Exit

BREAK causes an immediate loop exit.

FORMAT
BREAK

PARAMETERS

None

USAGE NOTES

  1. The next command to be executed is the following the next END-LOOP or END-FOR.

EXAMPLES

See example for "LOOP".

3.4.2.3 EMIT - Transfer Asynchronous Job Status

EMIT will transfer status data to the parent Terminal Monitor.

FORMAT
EMIT $SFI=integer $SKEY=string

PARAMETERS

  1. $SFI (optional; default is current value)The value of $SFI to be sent to the parent.

  2. $SKEY (optional; default is current value)The value of $SKEY to be sent to the parent.

USAGE NOTES

  1. EMIT is available only from asynchronous jobs.

  2. The user may monitor the status of an asynchronous job by using the SHOW-ASYNC command.

  3. EMIT does not alter the values of $SFI and $SKEY in the parent job or in the asynchronous job.

  4. The $ASFI and $ASKEY TCL functions (Section 3.3.5) may be used to access the emitted status data of an asynchronous job.

3.4.2.4 FOR/END-FOR - Itemized Loop Control

FOR introduces a loop with a variable assignment.

FORMAT

FOR variable-name = for-list
    loop body
END-FOR

USAGE NOTES

  1. The "for-list" is a list of numeric or string expressions, separated by commas or blanks. The "loop-body" is executed once for each item in the list, with the named variable assigned the value of each item in turn (as if a LET were executed).

  2. An END-FOR is required to mark the end of the loop body.

  3. The rules for the variable assignment are standard. See Section 3.3.

  4. The expressions in a for-list are evaluated once, at the time the FOR command is encountered (that is, not upon each iteration).

  5. All elements of the for-list must have the same type.

  6. The "variable-name" may not be subscripted.

EXAMPLES
  1. FOR X = 1, 2, 3 !Copy 3 files, from INFILEn IMGCOPY INFILE&X OUTFILE&X END-FOR
  2. FOR WINDOW = (1,10,1,10), (10,10,10,10) DISPIMAG RECTANGLE = @WINDOW END-FOR
  3. FOR I = X,Y,Z PROC @1 END-FOR

3.4.2.5 GETPAR - Get Dynamic Parameters

GETPAR obtains variable values from the interactive user.

FORMAT
GETPAR +
PARMS=variable-name-list PREFACE=preface-strings

PARAMETERS

  1. PARMS

    A list of variable names. The variables named must be declared in the declaration section of the procedure.

  2. PREFACE (optional)

    An override for the standard dynamic tutor preface ("Parameters requested: ..."). PREFACE may be multi-valued, in which case each component becomes a line in the preface.

USAGE NOTES

  1. GETPAR puts the user in dynamic tutor to obtain the values. If the PREFACE parameter is omitted from the GETPAR command, the user sees the standard dynamic tutor preface, i.e., "Parameters requested:" followed by the names of the variables.

  2. GETPAR is not allowed in BATCH jobs. GETPAR is allowed from ASYNC jobs submitted from an interactive session, in which case the interactive user must execute the REPLY command to initiate dynamic tutor for the requested variables. No NAME parameters are allowed in ASYNC.

  3. If the user exits from dynamic tutor using "EXIT", GETPAR returns $SFI=-1 and $SKEY="TAE-EXIT". TAE then executes the _ONFAIL(1) command.

  4. If a NAME parameter appears in the "variable-name-list," GETPAR obtains a value for the referenced variable (as opposed to the name of a new reference).

  5. The PARMS parameter may specify local, global, or parameter type variables. The tutor help for the variables is obtained from ".VARIABLE" directives in the help file associated with the current PDF.

  6. See Section 2.3.5 for additional information on using GETPAR.

EXAMPLE
  1. PROCEDURE HELP=* LOCAL L ... PARM P ... REFGBL G ... BODY . . . GETPAR L PREFACE = + ("Phase I execution is complete.", + "Type RUN followed by the number of new cycles.") . . . GETPAR (P, G) END-PROC .LEVELl .VAR L This is help for L. .VAR P This is help for P. .VAR G This is help for G. .END

3.4.2.6 GLOBALS - Introduce a GLOBALS PDF

GLOBALS is the first command in a global definition PDF.

FORMAT
GLOBALS HELP=help-location
    global definitions
    local declarations
    global references
END-GLOBALS

PARAMETERS

  1. HELP (optional)

    The name of the file containing the help information for this PDF and the defined global variables. If this parameter is omitted, TAE looks for a file of type "HLP" with the same name and library as the PDF.

    A value of "*" for "help-location" indicates that the help text is to be found immediately following the END-GLOBALS command.

USAGE NOTES

  1. GLOBALS must be the first command in the PDF and may not appear elsewhere.

  2. Global PDFs can be terminated with either the END-PROC command or the END-GLOBALS command.

  3. See Section 2.10 for a discussion of "global" PDFs.

  4. "GLOBAL" is an acceptable spelling of the "GLOBALS" TCL command.

3.4.2.7 GOTO - Unconditional Forward Branch

The GOTO statement instructs TAE to search forwards in the PDF and continue execution at the indicated label.

FORMAT
GOTO LABEL = label

PARAMETERS

  1. LABEL

    The label of the next line to execute.

USAGE NOTES

  1. The label must be a label for a line within the current procedure.

  2. The label must be on a line after the current line in the procedure (i.e., only "forward" GOTOs are permitted; "backwards" branching is available with the LOOP construct).

  3. A GOTO is not permitted on the interactive level.

  4. A GOTO is not permitted if the label is on in a line in a currently inactive loop body or currently inactive if-parts or else-parts. For example, the following is illegal:

    LOOP
    IF (X=4)
        GOTO THERE   !invalid:  violates nesting
    ELSE
    THERE> I = I+1
    END-IF
    END- LOOP
    

  5. Default Label for GOTO Branch:

    The statement label "_DEFAULT>" is a reserved statement label that matches any GOTO. This feature is useful when using the GOTO statement as a "dispatcher" as in the following example:

    procedure
        subcmd s1
           ...
        end-subcmd 
    
        subcmd s2 
           ...
        end-subcmd 
    
        subcmd s3 
           ...
        end-subcmd 
    
        subcmd s4 
           ...
        end-subcmd
    
    body
    goto @_subcmd        ! dispatch on active subcommand 
    s1>
        ! process subcommand s1
    
    s2>
        ! process subcommand s2
    
    _default>
    ! process all other subcommands

    GOTOs that are executed from an _ONFAIL command do not honor the _DEFAULT label. This rule permits exception processing to bypass a section of dispatch labels.

    The search for the target of a GOTO is in the forward direction. Because of this, several DEFAULT labels may be used in the same procedure. Consider the following coding sequence:

    goto @target1
    l1>...
    l2>...
    _default>...
    ...
    
    goto @target2
    l1>...
    l2>...
    _default>...
    

3.4.2.8 IF/ELSE - Conditional Execution

The IF/ELSE construct provides conditional execution based on the evaluation of the logical expression.

FORMAT

IF (logical-expression)
    if-part
ELSE
    else-part
END-IF

USAGE NOTES

  1. "if-part" and "else-part" are one or more TCL lines.

  2. If the logical expression is true, the "if-part" is executed, otherwise the "else-part" is executed.

  3. ELSE must appear standing alone on a line. (Comments are permitted.)

  4. The ELSE and the corresponding "else-part" are optional.

  5. A one-line IF is permissible. In this case, the single command to be executed follows the logical expression. ELSE, ELSE-IF, and END-IF may not be used with a one-line IF.

  6. Commands in a false "if-part" or "else-part" are not verified for proper syntax.

EXAMPLES

  1. IF (I = 1) INITDISP DEVICE = IAT !Initialize display ELSE DISPNEXT DEVICE = IAT !Display next END-IF
  2. IF (DEVICE = "IAT") WRITE "Device is an IAT"
  3. IF (WINDOW(4) > _MAXWIN(4)) WRITE "Window too big" END-IF

3.4.2.9 IF/ELSE-IF - Multi-way Conditional Execution

IF/ELSE-IF causes one of several groups of commands to be executed, depending on the evaluation of the respective conditions.

FORMAT

IF (logical-exp-1)
    part-1
ELSE-IF (logical-exp-2)
    part-2
. . .
ELSE
    else-part
END- IF

USAGE NOTES

  1. The only group of commands executed is the first "part-i" for which the logical expression evaluates true. If none of the logical expressions is true, then the "else-part" is executed.

  2. ELSE is not required.

  3. END-IF is required.

  4. Since IF, ELSE-IF, ELSE, and END-IF are TCL statements they cannot appear on the same line with another TCL statement.

EXAMPLES
    IF (x = 1)
        LET OPTION ="A"
    ELSE-IF (x = 2)
        LET OPTION = "B"
    ELSE-IF (x = 3)   
        LET OPTION = "C"
    ELSE
        WRITE "Unrecognized option. Try another."
    END- IF
    
    

3.4.2.10 LET - Variable Assignment

LET assigns an expression value to a variable.

FORMAT

LET variable-name = expression

USAGE NOTES

  1. The expression is evaluated and the variable is assigned the resulting value.

  2. Mixed-type assignments are not permitted.

  3. White space is permitted but not required on either side of the equals sign.

  4. Rules for expressions are described in Section 3.3.

  5. If a variable on the right hand side is multi-valued, then the list of values must use commas as separators (spaces are not permitted as separators).

  6. The variable-name may be subscripted. The subscript must be greater than zero and less than or equal to one greater than the current count for the variable. Thus, one new component may be added to the end of a multi-valued variable.

EXAMPLES

  1. LET X = Z + 3
  2. LET S="string" // X
  3. LET VECTOR=(1,2,3,4)
  4. LET $MENUS ($COUNT($MENUS)+1) = "MYMENU"
  5. LET I = X > Y OR A < B
  6. LET PARM.QUAL = X

3.4.2.11 LOCAL - Declare a Local Variable LOCAL declares a local variable.

FORMAT

LOCAL NAME = variable-name   or name-list

      TYPE = INTEGER or
             REAL or
             (STRING, maximum size of string) or
             FILE

      COUNT = integer:integer

      INITIAL = (integer,...) or
                (real,...) or
                (string,...)

       VALID = (integer:integer,...) or
               (real:real,...) or
               (string, string,...)

       ACCESS = IN or
                OUT or
                INOUT or
                NOCHECK

       QUALS = proc-name or
               "TCL command"

PARAMETERS

The parameters for the LOCAL command are identical to the parameters of the same name in the PARM command, except INITIAL:

INITIAL (optional)

The initial value. This value must be of the type and count allowed by the TYPE and COUNT attributes in the declarations.

USAGE NOTES

  1. A local variable may be declared only once in a PDF.

  2. LOCAL may be used in the body of a procedure.

EXAMPLES

  1. LOCAL I TYPE=INTEGER
  2. LOCAL r TYPE=REAL COUNT=2 INITIAL=(1.1, -3E3)
  3. LOCAL S TYPE=(STRING,20) INITIAL="FIRST MESSAGE"
  4. LOCAL (I,J,K) INTEGER
  5. LOCAL HI_ALT TYPE=STRING VALID=(TRUE,FALSE)
  6. LOCAL NAME INITIAL="P.P. JOHNSON"
  7. LOCAL S INITIAL = STRING

3.4.2.12 LOOP/END-LOOP - Infinite Loop

LOOP/END-LOOP provides an infinite loop.

FORMAT

LOOP loop-body END-LOOP

PARAMETERS

None

USAGE NOTES

  1. No other command may appear on the same line as LOOP.

  2. The loop is infinite; BREAK, GOTO, RETURN, or STOP must be used to exit the loop.

EXAMPLES

  1. LETI = 1 LOOP !DO I = 1, 10 IMGCOPY INFILE&I OUTFILE&I LET I = I+1 IF (I > 10) BREAK END-LOOP

3.4.2.13 NEXT - Force Next Iteration

NEXT forces a loop to the next iteration.

FORMAT

NEXT

PARAMETERS

None

USAGE NOTES

  1. NEXT causes the next command line executed to be the first one after the LOOP or FOR command of the innermost enclosing loop.

  2. NEXT is only permitted inside a loop body.

  3. If the innermost loop is a FOR loop, the loop continues with the next FOR loop element; if no more elements exist, the loop is terminated.

EXAMPLES

  1. LET I = 0 LOOP LET I = 1+1 IF (I > 10) BREAK !out, we're done GETIMAGE NEW = NEWIMAGE IF ($SKEY = "IMG-BADIMAGE") NEXT !Bad image, get a new one END- IF DSPIMAGE 1MG = NEWIMAGE END-LOOP

3.4.2.14 NOP - Do Nothing

NOP accepts any parameters (including parameters - with invalid syntax) and does nothing.

FORMAT

NOP

PARAMETERS

Any

USAGE NOTES

  1. NOP always executes normally, i.e., it returns a positive value for $SFI.

EXAMPLES

Assume proc P calls proc Q. You may cause P to bypass execution of Q with the following sequence:

DEFCMD Q NOP         !define Q to be NOP
P

3.4.2.15 PARM - Declare A Proc Parameter

PARM declares a proc parameter. In a global definition PDF, PARM defines a global variable.

FORMAT

PARM NAME = parameter-name  or name-list

     TYPE = INTEGER or
            REAL or
	    (STRING, size-of-string) or
	    NAME or
            FILE or
            VOID

     COUNT = integer:integer

     DEFAULT = (integer,...) or
               (real,...) or
               (string,...)

     VALID = (integer:integer,...) or
             (real:real,...) or
	     (string, string,...)

     ACCESS = IN or
              OUT or
              INOUT or
              NOCHECK or
              EVENT
	
     QUALS = proc-name or
             "TCL command"

or

PARM-PAGE with the same parameters as PARM.

PARAMETERS

  1. NAME

    Parameter-name. The name must follow the rules for TCL standard names. (See Section 3.2.2.)

    A list of names may also be supplied. Each name in the list receives the same parameter definition. (Defining multiple names in one PARM statement is considerably more efficient than using a separate PARM statement for each name.)

  2. TYPE (optional; default=STRING)

    The TYPE of the parameter; permitted types are INTEGER, REAL, STRING, FILE, KEYWORD, NAME, and VOID. If the type is STRING, then TYPE may have two elements: the first element is "STRING", and the second optional element is the maximum string length. The default maximum length is 132 characters. See Section 2.3.2 for a description of NAME parameters. (Output parameters must have type NAME.) A type of VOID is used by TAE Plus internally.

  3. COUNT (optional; default=1)

    The COUNT specifies the minimum and maximum number of values that the parameter may assume. If COUNT is single-valued then the value becomes the minimum and maximum. If COUNT is of the form "n:m", the first value is the minimum and the second the maximum; no spaces are permitted after the n or before the m. If COUNT is not specified, a count of one is assumed.

    The maximum count is 300.

    COUNT is also used to declare that a variable is nullable: if the minimum count is zero, then the variable is nullable. In addition, the COUNT may specify a non-zero range and the value zero, e.g., "COUNT = (0, 5:10)" declares a nullable variable for which substantial values must have a count between five and ten.

  4. DEFAULT (optional)

    The default value assumed if the proc is invoked with no value for the named parameter. If DEFAULT is not specified, the parameter is a mandatory parameter (that is, the user must specify a value on the proc invocation line or in tutor mode.)

    The DEFAULT values must be of the type and count allowed by the TYPE and COUNT attributes specified in this declaration. If a default is specified for a multi-valued parameter, all elements must be specified.

    The DEFAULT for a parameter of type NAME is resolved in the context local to the PDF containing the DEFAULT. When the proc is invoked, however, a NAME reference on the proc invocation line is resolved in the context of the invoking proc.

    The DEFAULT parameter on a PARM command defining a parameter with qualifiers may not be used to set values for the parameter's qualifiers. For example, a line of the form:

        PARM x QUALS=y DEFAULT=25|7,8|
    

    is not accepted.

  5. VALID (optional)

    The VALID values restrict the allowable set of values that a parameter may assume. If the parameter is an integer or a real then the VALID list consists of a list of inclusive ranges. If the parameter is a string, then the list is a list of acceptable values.

    A range is specified as a:b, meaning "a through b inclusive." No spaces are permitted after the "a" and before the "b". If ":b" is omitted, then "a" is the only permitted value.

    A VALID string must contain 132 or fewer characters. The VALID list is required for parameters of type KEYWORD.

  6. ACCESS (optional; default=NOCHECK)

    If the access is IN or INOUT, the parameter must have type FILE, and TAE verifies that the file exists. If the access is NOCHECK, no verification is made. (Note that file verification is not done if the global $FILEVER is set to "NO".) See the "Usage Notes" for the use of ACCESS=EVENT.

  7. QUALS (optional)

    The QUALS is the name of the proc that contains the declarations for qualifiers of the parameter. See Usage note #13 for more information.

USAGE NOTES

  1. The -PAGE subcommand for PARM may be used to indicate that the parameter is to appear at the top of the next tutor screen. This feature facilitates the grouping of parameters on tutor screens.

  2. PARM is legal within any type of PDF.

  3. See Section 2.3.1 for a discussion of the attributes of a parameter.

  4. It is an error if the name of the parameter is the same as another variable already defined.

  5. The allowable abbreviations for the parameter name when specified in a proc invocation are determined by the full set of parameters for the proc; the shortest abbreviation allowed is the shortest truncation possible that permits the parameter to be unambiguously identified. See the "TAE Command Language (TCL) User's Manual" for further discussion.

  6. If VALID specifies a set of strings, then a user may abbreviate any of the strings according to the same rules used for parameter name abbreviations.

    If, for example, VALID for a parameter is (DUMP, NODUMP), some valid values for the parameter are "DU" , , "DUMP" , or "N" , "NO", etc.

    If a user specifies an abbreviation, the value of the parameter is converted to the full string as specified in VALID. If, in the example above, the user had specified "d", the value of the parameter would be translated to "DUMP".

  7. VALID, COUNT, and ACCESS, are not permitted for TYPE=NAME.

  8. PARM is not permitted in the body of a procedure.

  9. See Section 2.2 for a discussion on proc inputs and outputs.

  10. If a VALID specification exists for a string variable, then the maximum string size is automatically set to 132. KEYWORD variables always have a maximum string length of 80.

  11. The proc specified by QUALS is made up of PARM statements, each defining a parameter qualifier for the named parameter in the current PARM statement. If QUALS is not specified, then no parameter qualifiers exist for the named parameter.

  12. The parameter type VOID and access value, EVENT, have been created to support the definition of TAE Plus interaction objects. See the "TAE Plus User Interface Developer's Guide" for a discussion on TAE Plus and interaction objects. A PARM command with access value, EVENT, indicates that a WPT event will be generated for a WPT program when the value of the parameter changes in a WPT panel. A type of VOID, only valid with an access of EVENT, implies that the interaction object returns no specific value; an example of this is the "button" interaction object. EVENT cannot be used with IN or INOUT.

  13. The "QUALS= " value may be a full command line, rather than a simple proc name. This allows a declaration to set new defaults and to restore a parfile:

        parm x quals="y|restore=y|z=2"
        parm y quals="y|restore=yy|z=3"
    

    Thus, parms with the same qualifier set do not have to have the same defaults. The following rules apply to QUALS:

    • The proc may be an internal proc residing in the same PDF. The proc is located the same way as a proc invoked within another proc. The search begins by looking for internally defined procs within the current proc then proceeds through the libraries using the normal hierarchy search.

    • There is no explicit limit to the nesting of qualifiers.

    • A parameter of type NAME will not be accepted as a qualifier.

    For details on parameter qualifiers, see Section 2.3.4.

EXAMPLES

  • PARM INT TYPE=INTEGER COUNT=2:4 DEFAULT=(10,20)
  • The number of values for this parameter must be at least two and at most four.
  • PARM OUTING TYPE=NAME
  • The parameter is passed to the proc by reference.
  • PARM-PAGE X TYPE=REAL VALID=(1.5:2, 25:35.7, 100)
  • The values for this parameter must be between 1.5 and 2, or between 25 and 35.7, or equal to 100. In screen tutor, the parameter always appears at the top of a tutor screen.
  • PARM S TYPE=STRING VALID=(LIST,DUMP)
  • The value for this parameter must be either "LIST" or "DUMP", or unambiguous abbreviations for "LIST" or "DUMP".
  • PARM RECORDS INTEGER COUNT=O:1 DEFAULT=--
  • The integer parameter RECORDS is nullable and may be assigned the null value.
  • REFGBL $SATID PARM SATID NAME DEFAULT=$SATID
  • The default reference for the SATID parameter is the global named $SATID. Because NAMEd defaults are resolved locally, $SATID must be referenced (via REFGBL) in the PDF.
  • PARM OUTPUT KEYWORD VALID=(LIST, NOLIST)
  • OUTPUT is a keyword parameter that accepts either LIST or NOLIST as values. The parameter value may be specified positionally, explicitly via "OUTPUT=value", or by flagging the value with the apostrophe (') character.
  • PROCESS PARMSET NAME=INTPROC PARM FILETYPE END-PROC PARM FILE QUALS=INTPROC END-PROC
  • Parameter Set INTPROC declares a string qualifier named FILETYPE for the string parameter named FILE.

    3.4.2.16 PARMSET - Introduce a Parameter Set PDF

    PARMSET/END-PROC bracket a parameter set PDF.

    FORMAT

    PARMSET  HELP=help-location  NAME=proc-name 
        variable declarations
    END-PROC
    
    or
    
    PARMSET-COMPILED and the same as above.
    

    PARAMETERS

    1. HELP (optional; default=name-of-proc)

      The name of the file containing the help information on this PDF and its parameters. If this parameter is omitted, TAE looks for a "HLP" type file with the same name and library as the PDF.

      A value of "*" for HELP indicates that the help text is to be found immediately following the END-PROC command.

    2. NAME

      The parameter set name of an internal proc.

    USAGE NOTES

    1. PARMSET must be the first command of a parameter set PDF and is not permitted elsewhere. See Section 2.8 for a discussion of parameter set PDFs.

    2. If PARMSET command is used for an internal proc, the NAME parameter must be specified and the HELP parameter is in effect ignored and is assumed to be the same as the HELP parameter of the main proc (i.e. the outermost proc).

    3. The NAME parameter will be ignored when PARMSET is used to define a main proc.

    4. The -COMPILED subcommand for PARMSET is used by the output of the COMPILE command. It flags the compiled version of a parameter set.

    5. PARMSET is useful to define parameter qualifiers in an internal proc.

    3.4.2.17 PROCEDURE - Declare a Procedure

    PROCEDURE/END-PROC bracket a procedure.

    FORMAT

    PROCEDURE  HELP=help-location + 
               NAME=proc-name OPTIONS=interrupt-opt
        declarations
    BODY     
        procedure body
    END-PROC
    
    or
    
    PROCEDURE-COMPILED and same as above.
    

    PARAMETERS

    1. HELP (optional; default=name of proc)

      The name of the file containing the help information on this procedure and its parameters. If this parameter is omitted, TAE looks for a "HLP" type file with the same name and library as the PDF.

      A value of "*" for HELP indicates that the help text is to be found immediately following the END-PROC command.

    2. NAME

      The proc name of an internal proc.

    3. OPTIONS (optional; valid = (INTERRUPT, NOINTERRUPT, SELFTUTOR, COMPRESSTUTOR) default=INTERRUPT)

      With "OPTIONS=NOINTERRUPT", the associated procedure cannot be aborted, even if "DISABLE-INTERRUPT" is in effect. SELFTUTOR is described in detail in Section 2.12 of this manual.

      With "OPTIONS=COMPRESSTUTOR", a more compact form of the traditional TAE tutor display will be used. The line spacing between parameters is omitted, allowing up to 18 scalar parameters on a 24-line display.

    USAGE NOTES

    1. PROCEDURE must be the first command of a procedure and is not permitted elsewhere. See Section 2.1 for a discussion on the structure of a procedure.

    2. If END-PROC is encountered during procedure execution, an implicit RETURN is executed.

    3. If PROCEDURE command is used for an internal proc, the NAME parameter must be specified and the HELP parameter is in effect ignored and is assumed to be the same as the HELP parameter of the main proc (i.e. the outermost proc).

    4. The NAME parameter will be ignored when PROCEDURE is used to define a main proc. (The file name of the PDF becomes the proc's name.)

    5. The -COMPILED subcommand for PROCEDURE is used by the output of the COMPILE command. It flags the compiled version of a procedure.

    6. Procedure PDFs can be terminated with either the END-PROCEDURE or END-PROC command.

    EXAMPLE

    1. PROCEDURE
      
      !Internal proc for parameter qualifiers
          PARMSET NAME INTPROC
          PARM BAND INTEGER
          END-PROC
      
      !COPY - Use IMGCOPY primitive
      PARM INFILE FILE ACCESS = IN QUALS = INTPROC
      PARM OUTFILE FILE ACCESS = OUT QUALS = INTPROC
      LOCAL I INTEGER
      
      BODY
          FOR INFILE.BAND = 1, 2, 3, 4, 5, 6
              IMGCOPY INFILE, OUTFILE, @INFILE.BAND
          END-FOR
      END-PROC
      
    2. See Section 2.1.

    3.4.2.18 PROCESS - Declare a Process

    PROCESS/END-PROC bracket a process definition.

    FORMAT

    PROCESS EXECUTE = file-spec +
            HELP = help-location +
            OPTIONS = interrupt-opt +
            NAME = proc name
    
        declarations
    
    END-PROC
    
    or
    
    PROCESS-COMPILED and same as above.
    

    PARAMETERS

    1. EXECUTE (optional)

      The name of the executable image file for the process to execute. If EXECUTE is not specified, then the executable image file is assumed to be in the same library as the PDF, with a name the same as the proc name (type EXE).

    2. HELP (optional; default=name of proc)

      The name of the file containing the help text for this proc and its parameters. If this parameter is omitted, TAE looks for the HELP information in a "HLP" type file with the same name and library as the PDF.

      A value of "*" for the HELP parameter indicates that the help text is to be found immediately following the END-PROC command.

    3. OPTIONS (optional; valid (INTERRUPT, NOINTERRUPT, SELFTUTOR, COMPRESSTUTOR), default=INTERRUPT)

      The most common setting for OPTIONS is INTERRUPT. If OPTIONS is NOINTERRUPT, the TAE interrupt mode is suppressed, and the user will not be able to abort the proc. SELFTUTOR is described in detail in Section 2.12 of this manual.

      With "OPTIONS=COMPRESSTUTOR", a more compact form of the traditional TAE tutor display will be used. The line spacing between parameters is omitted, allowing up to 18 scalar parameters on a 24-line display.

    4. NAME

      The proc name of an internal proc.

    USAGE NOTES

    1. PROCESS must be the first command of a process and is not permitted elsewhere.

    2. If PROCESS command is used for an internal proc, the NAME parameter must be specified and the HELP parameter is assumed to be the same as the HELP parameter of the main proc (i.e. the outermost proc).

    3. The NAME parameter will be ignored when PROCESS is used to define a main proc. (The file name of the PDF becomes the proc's name.)

    4. The -COMPILED subcommand for PROCESS is used by the output of the COMPILE command. It flags the compiled version of a procedure.

    EXAMPLES

    1. PROCESS
      
      ! IMGCOPY
      PARM IN FILE ACCESS     = IN
      PARM OUT FILE ACCESS    = OUT
      PARM BAND INTEGER RANGE = 1:6
      END-PROC
      
    2. See Section 2.1

    3.4.2.19 PUTMSG - Write a Message to Standard Output

    PUTMSG writes a TCL message to the standard output device and the session log, in standard message format.

    FORMAT
    1. PUTMSG-NOTRACE MESSAGE=string KEY=string or PUTMSG MESSAGE=string KEY=string
    2. PUTMSG-TRACE MESSAGE=string KEY=string

    PARAMETERS

    1. MESSAGE

      The text part of the message. If the message contains the "%" character it must be preceded by another "%".

    2. KEY (optional; default=TAE-NOKEY)

      The message key for the message.

    USAGE NOTES

    1. See Section 2.16 for a discussion of message formats.

    2. If the text string contains the character "%", it must be preceded by another character "%". See example below.

    3. PUTMSG writes the message to the terminal even if the terminal is not the standard output device.

    4. The -TRACE subcommand will attach the line number and proc name of the PUTMSG command to the message sent to the terminal.

    5. PUTMSG sets the global variable $SKEY to the value of "KEY".

    6. See Section 2.2 for a discussion on the standard output device.

    7. If logging is enabled, PUTMSG also writes the message with the trace information to the session log. (See the "TAE Command Language (TCL) User's Manual" for a discussion on session logging.)

    8. TM executes the _ONFAIL command if PUTMSG fails.

    EXAMPLES

    1. The commands

          LET FILE = "IMG"
          PUTMSG "File &FILE not found.", +
          KEY="GP-NOFILE"
      
      will produce the following output on the standard output device:
          [GP-NOFILE] File 1MG not found.
      
    2. The commands
          LET FILE = "IMG"
          PUTMSG-TRACE "File &FILE not found.", +        
          KEY= "GP-NOFILE"
      
      will produce the following output on the standard output device:
          [GP-NOFILE] File IMG not found.;
          proc 'example', line n.
      
    3. The command
          PUTMSG "%%r a"
      
      will produce the following output:
          [TAE-NOKEY] %r a
      
      

    3.4.2.20 RECVAR - Receive Variables from Another Job.

    RECVAR receives a collection of variables (a V-block) from another job. RECVAR blocks until the message is received.

    FORMAT

    RECVAR VARIABLE=(vl, v2, v2...) JOB=jobname
    

    PARAMETERS

    1. VARIABLE (optional)

      The list of TCL variables to be received.

    2. JOB (optional)

      Name of the job transmitting the message. The default is "ALL", meaning RECVAR will receive from any job.

    USAGE NOTES

    1. RECVAR blocks until the next message is received on the job's input queue. Under VMS, a RECVAR command may not be interrupted with CONTROL/C.

    2. RECVAR may receive messages from an ASYNC TCL procedure, in which case RECVAR corresponds to a SENDVAR command in the transmitting ASYNC job. RECVAR may also receive messages from processes, in which case the transmitting process constructs the V-block messages using the standard q_ functions and transmits the messages using the c_pmwcd function. (See the "TAE Command Language (TCL) User's Manual.")

    3. If the incoming message does not supply values for one or more of the variables specified on the RECVAR command, the specified variables are not changed and no error condition is indicated.

    4. If the incoming message contains variables that are not mentioned in the RECVAR command, these variables are ignored.

    5. If no variables are specified on the RECVAR command, then the purpose of the RECVAR command is to wait until the next message is received.

    6. The variables specified on the command line must be compatible with the definition of the received variables. For example, an INTEGER named X in a received message may not be assigned to a REAL named X in the receiving proc.

    7. If JOB is specified, then RECVAR examines the next message on the input queue for a match; messages are discarded until a match is found.

    8. An ENABLE-RECVAR command must be issued before RECVAR is used.

    9. Every message should contain a string variable named _JOB, the jobname of the sender. Messages initiatd by the SENDVAR command automatically have the _JOB variable. Messages constructed by application programs must explicitly place the _JOB variable in the V-block.

    10. MAJOR RESTRICTION for UNIX implementations: A FIFO queue of messages cannot be guaranteed. UNIX interprocess communications are limited to 4K byte pipe sizes. As a result, there appears to be an upper limit of about five messages queued at one time. Versions of TAE prior to v5.2 could not send V-blocks larger than the pipe size. In version 5.2 this restriction was relaxed. A V-block will automatically be broken down into as many pipe size blocks as necessary, sent, then reassembled on the receiving side.

    EXAMPLE

    This example shows a (trivial) server that adds one to the value of a variable.

    Procedure                     !simple server
        refgbl $parent            !parent's job name
        local _job string
        local value integer
    body     enable-recvar        !enable server queue 
    sendvar job=@$parent          !synchronize with parent
    loop                          !begin serving
        recvar (_job, value)      !receive request       
        let value = value + 1     !operate on request
        sendvar value job=@_job   !return to requestor
    end-loop
    end-proc
    
    

    3.4.2.21 REFGBL - Declare a Reference to a Global

    REFGBL declares that the named globals are used in the proc.

    FORMAT

    REFGBL NAME = (name-1, name-2, ...)
    

    PARAMETERS

    1. NAME

      The name of the variable referenced. The maximum number of names is 50.

    USAGE NOTES

    1. REFGBL is permitted in any PDF.

    2. REFGBL is required for any global referenced by a proc.

    3. REFGBL may be used in the body of a procedure.

    4. REFGBL is not allowed at the interactive level. On the interactive level, all globals are implicitly referenced.

    EXAMPLES

    1. REFGBL NAME = SATID
    2. REFGBL window
    3. REFGBL (termid, userid, $session)

    3.4.2.22 RETURN - Terminate Procedure Execution

    RETURN terminates procedure execution.

    FORMAT

    RETURN $SFI=integer $SKEY=string
    

    PARAMETERS

    1. $SFI (optional)

      The value to which the $SFI global is to be set upon procedure exit.

    2. $SKEY (optional)

      The value to which the $SKEY global is to be set upon procedure exit.

    USAGE NOTES

    1. RETURN is permitted only in a procedure body.

    2. The values of SSFI and $SKEY at the time of a RETURN determine the completion status of the procedure. See Section 3.5. If $SFI and $SKEY are not set using the optional parameters of the RETURN command, the RETURN operation does not change the current values of $SFI and $SKEY.

    EXAMPLES

    1. RETURN
    2. RETURN -1, OVERFLOW

    3.4.2.23 SENDVAR - Send Message to Another Job.

    SENDVAR packages a collection of TCL variables into a message (a TAE V- block) and sends the message to another job.

    FORMAT

    SENDVAR VARIABLE=(vl, v2, v3, ...) JOB=jobname
    

    PARAMETERS

    1. VARIABLE (optional)

      List of TCL variables to be placed in the message.

    2. JOB

      The name of the JOB to receive the message.

    USAGE NOTES

    1. Unlike RECVAR, SENDVAR is non-blocking, i.e., the message is placed in the target job's queue and execution proceeds with the command following SENDVAR.

    2. Every message transmitted by SENDVAR automatically contains a string variable named _JOB that identifies the transmitting job.

    3. The target job may be a TAE ASYNC procedure, in which case the SENDVAR corresponds to a RECVAR in the receiving ASYNC job. The target may also be an ASYNC-PROCESS job or any other job that has created an input queue with c_crepath and that reads the queue with c_getmsg.

    4. MAJOR RESTRICTION for UNIX implementations. A FIFO queue of messages cannot be guaranteed. UNIX interprocess communications are limited to 4K byte pipe sizes. As a result, there appears to be an upper limit of about five messages queued at one time. Versions of TAE prior to v5.2 could not send V-blocks larger than the pipe size. In version 5.2 this restriction was relaxed. A V-block will automatically be broken down into as many pipe size blocks as necessary, sent, then reassembled on the receiving side.

    5. Constants are not allowed in the variable list. For example, the following is invalid:

          SENDVAR (A, B, "input string")  JOB=XYZ   !invalid
      

    EXAMPLE

    The following example shows two TAE procs. The first proc is a simple server; the second proc submits the server for asynchronous execution and sends two requests to the server.

    procedure                     !simple server
        refgbl $parent            !parent's job name
        local _job string         
        local value integer 
    body 
    enable-recvar                 !enable server queue
    sendvar job=@$parent          !tell parent we're ready
    loop
        recvar (_job, value)      !receive request
        let value = value + 1     !operate on request
        sendvar value job=@_job   !return to requestor
    end-loop
    end-proc
    
    
    procedure                        !request service from server
        local value integer initial=1 
    body 
    enable-recvar 
    server |run=(async, myserver)|   !start the above server
    recvar job=myserver              !wait till server ready
    sendvar value job=myserver       !request service
    recvar value job=myserver 
    display value 
    sendvar value job=myserver       !request service
    recvar value job=myserver 
    display value 
    end-proc
    
    

    3.4.2.24 STOP - Terminate All Procedure Levels

    The STOP command terminates the current procedure and all higher level active procedures.

    FORMAT

    STOP
    

    PARAMETERS

    None.

    USAGE NOTES

    After the STOP command is executed, TAE proceeds to request a new command on the primary level. (The relationship between STOP and RETURN in FORTRAN is similar to the STOP and RETURN in TCL).

    3.4.2.25 SUBCMD/END-SUBCMD - Subcommand Definition

    SUBCMD/END-SUBCMD declares a set ofvariables (usually parameters) to be associated with the named subcommand.

    FORMAT

    1. SUBCMD NAME=subcommand-name declarations END-SUBCMD
    2. SUBCMD-DEFAULT NAME=subcommand-name declarations END-SUBCMD

    PARAMETERS

    1. NAME

      The name of the subcommand, a TCL standard name. The name must not have more than twelve characters.

    USAGE NOTES

    1. SUBCMD-DEFAULT makes the named subcommand the default subcommand.

    2. The parameters and variables declared between SUBCMD and END-SUBCMD are associated with the specified subcommand.

    3. Parameters and variables declared outside of SUBCMD/END-SUBCMD "brackets" are associated with all subcommands.

    4. Only PARM, LOCAL, and REFGBL may appear between SUBCMD and END-SUBCMD. A subcommand may not be defined within a SUBCMD/END-SUBCMD bracket.

    5. The implicitly defined local variable, _SUBCMD, is automatically set to the subcommand name corresponding to the subcommand specified when the proc is invoked. _SUBCMD uses the full name, even if the proc invocation may have specified an abbreviation for the subcommand.

    6. No subcommand name may be a left substring of another subcommand name, e.g., "COPY" and "COPYALL" may not be subcommands of the same proc.

    7. See Section 2.7 for details on subcommands.

    EXAMPLES

    1. PROCESS !TAPE UTILITY
      
      PARM TRIES INTEGER DEFAULT=1
      
      SUBCMD-DEFAULT READ
          PARM RECORDS INTEGER
      END-SUB
      
      SUBCMD FILEMARK
          PARM NUMFILES INTEGER
      END-SUB
      
      END-PROC
      
    2. See Section 2.7.

    3.4.2.26 SWITCH - Set switch bits

    SWITCH sets the switch bits in the implicit global $SWITCH.

    FORMAT

    SWITCH VALUE=hexadecimal-value
    

    PARAMETERS

    1. VALUE

      The value to be placed into $SWITCH.

    USAGE NOTES

    • If SWITCH fails, the current _ONFAIL command is executed.

    • Two $SWITCH values are of special interest.

      1. SWITCH 1 - enables debug mode for application processes.

      2. SWITCH 20 - (32 decimal) disables all validation of a parameter's value. TAE Plus uses this to disable validation during .rfg file to .res file translation.

    EXAMPLES

    1. SWITCH 3
    2. SWITCH FOOF

    3.4.2.27 WPT - Window Programming Tools

    The WPT subcommands specified on the following pages give TAE Plus users the ability to prototype WPT application programs using TCL.

    TAE Plus allows user interface designers to design "point-and-click" user interfaces of the kind popularized by Apple's Macintosh. It includes a user interface design tool (the WorkBench), a subroutine package that makes use of the WorkBench's output (WPT), and the WPT TCL commands described on the following pages. See the "TAE Plus Overview" manual for introductory material on TAE Plus; the "TAE Plus User Interface Developer's Guide" for information on how to prototype with the WPT command; and the "TAE Plus (language) Reference Manual (UNIX, VMS)" for information on the WPT subroutine package.

    WPT subcommands correspond to functions in the WPT subroutine package, as follows:

    WPT Package Function WPT Subcommand
    Wpt_AddEvent none
    Wpt_AddTimer none
    Wpt_BeginWait WPT-BEGINWAIT
    Wpt_CCInit none
    Wpt_CheckEvent none
    Wpt_CloseDisplay none
    Wpt_CloseItems none
    Wpt_EndWait WPT-ENDWAIT
    Wpt_Finish none
    Wpt_GetConstraintSensitivity none
    Wpt_GetHelpStyle none
    Wpt_GetIntgConstraints none
    Wpt_GetItemSensitivity none
    Wpt_GetMenu none
    Wpt_GetMenuEntryPath none
    Wpt_GetPanelState none
    Wpt_GetRealConstraints none
    Wpt_GetStringConstraints none
    Wpt_Init WPT-INIT
    Wpt_InsertMenuEntries none
    Wpt_ItemWindow none
    Wpt_KeyinCheckForNuLLInput none
    Wpt_MenuUpdate none
    Wpt_MissingVal none
    Wpt_NextEvent WPT-EVENT
    Wpt_NewPanel WPT-PANEL
    Wpt_OpenDisplay none
    Wpt_PanelDisplayId none
    Wpt_PanelErase WPT-ERASE
    Wpt_PanelMessage WPT-MESSAGE
    Wpt_PanelMessageNoBlock none
    Wpt_PanelMissingVal none
    Wpt_PanelReset none
    Wpt_PanelWindow none
    Wpt_PanelTopWindow none
    Wpt_PanelWidgetld none
    Wpt_ParmReject WPT-REJECT
    Wpt_ParmRejectNoBlock none
    Wpt_ParmUpdate WPT-PARMUPDATE
    Wpt_Pending none
    Wpt_RemoveEvent none
    Wpt_RemoveMenuEntries none
    Wpt_RemoveTimer none
    Wpt_Rehearse WPT-REHEARSE
    Wpt_SetConstraintSensitivity none
    Wpt_SetIntg none
    Wpt_SetIntgConstraints none
    Wpt_SetItemSensitivity none
    Wpt_SetHelpStyle none
    Wpt_SetMenu none
    Wpt_SetMenuSensitivity none
    Wpt_SetNoValue none
    Wpt_SetPanelState WPT-SETPANELSTATE
    Wpt_SetReal none
    Wpt_SetRealConstraints none
    Wpt_SetString none
    Wpt_SetStringConstraints none
    Wpt_SetTimeOut (timeout parm for WPT-EVENT)
    Wpt_ViewUpdate WPT-VIEWUPDATE


    WPT-BEGINWAIT - Set Wait Indicator

    WPT-BEGINWAIT sets the "wait indicator." Use of this command will indicate to the user that the specified panel(s) is temporarily in a wait state and is not available for interaction. The indication to the user of this wait state is that the cursor becomes an hourglass icon.

    FORMAT

    WPT-BEGINWAIT PANEL parameter-name
    

    PARAMETERS

    1. PANEL

      Name(s) of the panel(s) to receive the wait indicator. If the panel parameter is "ALL", then all panels receive the wait indicator.


    WPT-ENDWAIT - Remove Wait Indicator

    WPT-ENDWAIT Removes the "wait indicator." See the description of WPT- BEGINWAIT for an explanation of the wait indicator.

    FORMAT

    WPT-ENDWAIT PANEL = parameter-name
    

    PARAMETERS

    1. PANEL

      Name(s) of the panel(s) to have the wait indicator removed. If the panel parameter is "ALL", then all wait indicators are removed.


    WPT-ERASE - Erase a Panel from the Screen

    WPT-ERASE erases a panel from the, screen.

    FORMAT

    WPT-ERASE PANEL = panel-name
    

    PARAMETERS

    1. PANEL

      Name of panel to be erased. The name of a panel is established at the time of panel creation with WPT-PANEL. If the PANEL parameter is "ALL", all panels are erased from the screen.


    WPT-EVENT - Wait for the next WPT event

    WPT-EVENT waits for the next WPT event and delivers event information. When an event is received from a panel, the target variable identified by WPT-PANEL is updated to reflect the current values on the screen.

    FORMAT

    WPT-EVENT PARM = parm-name
    
              PANEL = panel-name
    
              TIMEOUT = seconds
    

    PARAMETERS

    1. PARM

      The name of a TCL string variable to receive the name of the parameter that generated the event.

    2. PANEL (optional)

      The name of a TCL string variable to receive the name of the panel that generated the event.

    3. TIMEOUT (optional; default=0)

      Time to wait before generating a "timeout" event. See Usage Notes. The default, 0, implies no timeout.

    USAGE NOTES

    • When the timeout time expires, WPT generates an event with the panel name set to "WPT EVENT" and the parameter name set to "TIMEOUT".

    EXAMPLE

    !
    ! Sample procedure showing use of timeout.
    ! Par files are assumed to have been created (by the WB).
    !
    procedure
        local (parm, panel)
    body
    disable-force_lower  !permit upper/lower file names
    let _onfail = "continue"
    !*************************************
    wpt-init
    !*************************************
        local VV quals="example_v.par"  ! view variable
        local TV quals="example_t.par"  ! target variable
    !*************************************
    !   put up the panel and wait for events from help or exit
    !   or timeout
    !
    wpt-panel target=TV view=VV	! display Main Menubar
    loop
        wpt-event parm=parm pane1=pane1 timeout=10
        goto &"panel"_&"parm"	! dispatch on panel/parm
        example_help>		!" help" parm
            wpt-message p="&panel" m="Help button"
            next
        example_exit>
            wpt-erase all		! "exit" parm
            return
            next
        WPT_EVENT_TIMEOUT>
            wpt-message "" "Come on, DO SOMETHING!"
            next
    end-loop
    cleanup> wpt-erase all
    enable-force_lower  !return to lowercase-only file names 
    end-proc
    
    

    WPT-INIT - Initialize the WPT package

    WPT-INIT initializes the WPT package. Should be executed before any other WPT TCL command.

    FORMAT

    WPT-INIT HOST = host
    
             DISPLAY = display
    
             PROTOCOL = protocol
    

    PARAMETERS

    1. HOST (optional)

      The name of the display's host node. "UNIX", the default, is a special string that implies the local node.

    2. DISPLAY (optional)

      Display number. (The main console is 0, default.)

    3. PROTOCOL (optional)

      DECnet or TCP.

    USAGE NOTES

    • If HOST = "$DISPLAY" or none of the parameters are specified, and if the defaults, (UNIX, 0, TCP), do not lead to a recognized console, then for UNIX, the UNIX shell variable, DISPLAY, will be used. VMS systems will use the logical name DECW$DISPLAY rather than $DISPLAY.

      (DISPLAY is of the form "host:display.screen" where "host" and "display" are the same as the parameters to WPT-INIT, the colon implies "TCP", and "SCREEN" is a screen number for the display (default 0).)


    WPT-MESSAGE - Create a dialog box

    WPT-MESSAGE creates a dialog box for communicating information to the user.

    FORMAT

    WPT-MESSAGE PANEL = panel-name
    
                MESSAGE = message
    

    PARAMETERS

    1. PANEL

      Name of the panel to which the dialog box is to be attached. The name of a panel is established at the time of panel creation with WPT-PANEL.

    2. MESSAGE

      String to be displayed in the dialog box. (The dialog box also contains a NOTED icon used to dismiss the dialog box.)

    USAGE NOTES

    • WPT-MESSAGE displays the message and returns after the user selects the NOTED icon. This is known as "blocking." No other TCL command will execute until the message display is dismissed.


    WPT-PANEL - Create a WPT panel

    WPT-PANEL creates a WPT panel and enables the receipt of events from the

    panel. The panel may be created in one of several states.

    FORMAT

    WPT-PANEL VIEW = view
    
              TARGET = target
    
              PANEL = panel-name
    
              STATE = state
    

    PARAMETERS

    1. VIEW

      Name of a TCL variable that, through qualifiers, contains a parameter set defining the view parameters for the panel. The qualifiers define the presentation and position of the panel.

    2. TARGET (optional)

      Name of a TCL variable that, through qualifiers, contains a parameter set defining the target parameters of the panel. When the user sets a value through the panel, the proper qualifier is updated. Target qualifiers are only updated then WPT-EVENT receives an event from the panel; thus, a panel typically has at least one ACCESS=EVENT parameter.

      For a parameter that has a set of discrete constraints (created using the WorkBench's "Constraints" option for an item), WPT automatically creates a TAE variable "qualifier" named _SELECT. _SELECT is an integer containing the TCL index (starting with 1) of the parameter's value selection from the constraint list. A value of 0 for _SELECT implies no valid selection exists for the string parameter. The programmer accesses this index value by using Vm_Find to request the variable P._SELECT, where P is the string parameter name. (If _SELECT already exists, then WPT updates the index.)

      If this parameter is omitted, then there are no parameters associated with the window. In this case, TAE decorates the panel according to the view parameters. Such panels are used for graphic output by the application. Note that no WPT-EVENT events are generated from such panels.

    3. PANEL (optional)

      The name to be assigned to the panel. This name is used to reference the panel from the other WFT commands. If panel is omitted, then the name defined by view.PANEL.NAME becomes the panel name, where "view" is the name of the view TCL variable.

    4. STATE (optional)

      Defines the creation state of the panel. The valid choices are:

      1. "fast iconic" - Create only the minimum internal structure of a panel then display its panel icon. The rest of the panel will be created when the panel is made "visible" or de-iconified.

      2. "iconic" - Completely create the panel offscreen then display its panel icon.

      3. "invisible" - Create the panel off screen (withdrawn). The display will remain unchanged. Use WPT-SETPANELSTATE to later change the panel state to "visible".

      4. "moda1" - Create the panel visible and modal. Only one modal panel may be displayed at one time. The application must remove this panel before any events for other of its panels may be received.

      5. "preferred" - Use the state defined by the panel designer.

      6. "visib1e" - Create the panel in the normal state. Display the panel to the user. (DEFAULT)

      7. "child" - NOT SUPPORTED in TCL


    WPT-REHEARSE - Simulate Data Driven Object Updates

    WPT-REHEARSE turns on or off the simulated update of all Data Driven Objects (DDOs) on all visible application panels. The update interval and style of updating may be specified. DDOs on panels made visible after this call are automatically added to the internal list of DDOs to update. Iconic and invisible panels will not have their DDOs updated. When a panel is erased, its DDOs will be removed from the inernal list.

    The DDOs will cycle through values defined using their own minimum and maximum values. Each color or picture range will be used.

    FORMAT

    WPT-REHEARSE INTERVAL = interval
                 ORDER = order
                 CYCLES = cycles
    

    PARAMETERS

    1. INTERVAL

      Time duration, in milliseconds, between updates of the data driven objects.

    2. ORDER

      Defines the starting value and the direction of each update. Valid values are:

      "Min-Max" Start at minimum value and increase to the maximum value. Restart at minimum on repeat.
      "Max-Min" Start at maximum value and decrease to the minimum value. Restart at maximum on repeat.
      "Min-Max-Min" Start at minimum value, increase to maximum then decrease to the minimum. Continue on repeat. (DEFAULT)
      "Max-Min-Max" Start at maximum value, decrease to minimum then increase to the maximum. Continue on repeat.
    3. CYCLES

      Defines the repetition option. Valid values are:

      "repeated" Continue cycling as defined by the ORDER. (DEFAULT)
      "once" Cycle once for each DDO then stop.


    WPT-SETPANELSTATE - Change the current display state of a panel

    WPT-SETPANELSTATE changes the current display state of a panel.

    FORMAT

    WPT-SETPANELSTATE PANEL = panel-name
    
                      STATE = state-name
    

    PARAMETERS

    1. PANEL

      Name of the panel to have its state changed.

    2. STATE

      Specifies the new state of a panel. It is often called after a determination of the current panel state using WPT-GETPANELSTATE. See WPT-PANEL for a description of each panel state. Valid states are:

      1. "iconic" or "fast iconic"

        • If panel is visible or invisible, iconify it.

        • If panel is iconic, make no change.

        • If panel is modal, FAIL.

      2. "invisible"

        • If panel is visible, make it invisible.

        • If panel is invisible, make no change.

        • If panel is iconic, make it invisible.

        • If panel is modal, FAIL.

      3. "visible"

        • If panel is visible, raise it to the top of the window stack.

        • If panel is invisible, make it visible and raise it to the top of the window stack.

        • If panel is iconic, restore it and raise it to the top of the window stack.

        • If the panel is modal, raise it to the top of the window stack.

      4. "preferred" - use the state defined in the panel's view.


      WPT-PARMUPDATE - Update a Parm Display

      WPT-PARMUPDATE updates a parameter display. The parameter display may be given a new value, a new selection or a new valid list. The new value, new valid list, or new selection must have already been set. The "LET" TCL command can be used for this purpose.

      FORMAT

      WPT-PARMUPDATE PANEL = panel-name
                              
                     PARM = parameter name
      

      PARAMETERS

      1. PANEL

        Name of the panel where an updated parameter is displayed.

      2. PARM

        Name of a parameter to be updated.

      EXAMPLE

      Example of updating a Data Driven Object (DDO).

      Assume you have a panel "p1" with a DDO item called "stretcher". Your TCL procedure might have:

      local p1V quals="p1_v.par"  ! view variable
      local p1T quals="p1_t.par"  ! target variable
      WPT-PANEL view=p1V target=p1T panel=p1  ! display panel
      ...    ! other TCL commands
      loop   ! main event loop
         ...    ! dispatching 
      "p1_stretcher">
           let p1T.stretcher = 1.0
           WPT-PARMUPDATE panel=p1 parm=stretcher
      ...    ! other TCL commands
      
      

      WPT-REJECT - Generate a rejection message

      WPT-REJECT generates a rejection message for a user-supplied parameter value. This command displays the message in a WPT-generated dialog box. The rejected parameter value remains present on the screen until the user acknowledges the dialog box, at which time the message is deleted and the value reverts to the previous value. This command is used when the user wants TCL code to check the value of certain parameters as they are given values. Such parameters must be declared as ACCESS=EVENT.

      FORMAT

      WPT-REJECT PANEL = panel-name
      
                 PARM = parm-name
      
                 MESSAGE = message
      

      PARAMETERS

      1. PANEL

        Name of the panel containing the parameter to be rejected. The name of a panel is established at the time of panel creation with WPT-PANEL.

      2. PARM

        Name of the target parameter whose new value is to be rejected.

      3. MESSAGE

        String to be displayed in the dialog box. (The dialog box also contains a NOTED action button used to dismiss the dialog box.)


      WPT-VIEWUPDATE - Update the view of an item

      WPT-VIEWUPDATE updates the view of an item on an existing panel.

      FORMAT

      WPT-VIEWUPDATE PANEL = panel-name
      
                     PARM = parm-name
       
                     VIEW = view
      

      PARAMETERS

      1. PANEL

        Name of the panel containing the parameter whose view is to be changed. The name of a panel is established at the time of panel creation with WPT-PANEL.

      2. PARM

        Name of the parameter whose view is to be changed.

      3. VIEW

        The name of a TCL variable whose qualifiers define the new display characteristics for the PARM. Note, this is the view for the PARM, not the view for the panel.

      USAGE NOTES

      • Any of the following display characteristics of an item may be changed: the background/foreground colors, and title.

      • The presentation type on any items may not be changed by WPT-VIEWUPDATE.

      • This command is used to:

        1. Change an icon. Any of the following display characteristics of an item may be changed: the background/foreground colors, and title, rotation angle, and the icon bitmap itself.

        2. Change the text associated with static text. Any of the following display characteristics may be changed: the background/foreground colors, and the text itself.

        3. Change the text in a text display item.


      3.4.2.28 WRITE - Write a String to the Standard Output Device

      WRITE writes the specified string to the standard output device.

      FORMAT

      WRITE STRING = string
      

      PARAMETERS

      1. STRING

        The string that is to be written to the standard output device.

      USAGE NOTES

      1. See Section 2.2 for a discussion on the standard output device.

      2. The _ONFAIL command is triggered if WRITE fails.

      EXAMPLES

      1. WRITE "Please turn the BANDS switch to &BAND"