HP 3000 Manuals

Interactive Use of Script Commands [ HP DeskManager Customization ] MPE/iX 5.0 Documentation


HP DeskManager Customization

Interactive Use of Script Commands 

This script below permits interactive use of HP Desk script directives.
The first line sets the script to permit errors and not cause the script
to abort.  Beware that if the lines of the above script are not typed
correctly, the &ERRABORT directive will cause the script to enter an
infinite loop.  The only way to stop a loop in a script is to break out
of HP Desk by pressing the Break key and issuing the MPE ABORT command.

The <PROMPT> function issues a prompt of an ampersand character (&).
Whatever the user inputs is passed back as the result of the <PROMPT>
function.  This goes to a function called <ACTIVEFN> which forces
evaluation of any active function that it takes as a parameter in its
command line.  The result of the <ACTIVEFN> call is returned as the line
of the script and since the line starts with an ampersand character, and
HP Desk will attempt to execute the string as a script directive.

The &BACK 1 directive loops back one line so that the prompt is repeated
indefinitely until the user either types EXIT or simply hits Return where
the default return from the <PROMPT> function (the word "EXIT") will
cause the script to terminate.  If anything else is entered <ACTIVEFN>
will attempt to evaluate it.  You may decide that the EXIT command must
be typed to terminate the script in which case the default <PROMPT>
return may be omitted.

     &COMMENT  Execute script directives interactively.
     &ERRABORT 0
     &<ACTIVEFN <PROMPT "&" "EXIT">>
     &BACK 1



MPE/iX 5.0 Documentation