What Sort of Commands can be Used? [ HP DeskManager Customization ] MPE/iX 5.0 Documentation
HP DeskManager Customization
What Sort of Commands can be Used?
The types of commands which can be included in script files can be
divided into three categories, which can be mixed together to create a
single script file. The categories are:
* Normal HP Desk commands:
Any command you would type while using HP Desk. For example,
READ, SEND, LIST, PRINT, PROFILE.
* MPE commands:
Most MPE commands are allowed in scripts but they must be preceded
by a colon (:) character. A list of MPE commands that are not
available in HP Desk (and therefore also not available within
script files) is given in Appendix B . Script files which have
been INSTALL ed by a script administrator and contain MPE
commands, can be used by users who do not have MPE capability (as
with abbreviations). This is a way of giving a limited set of MPE
commands to users, while preventing them from accessing the
command interpreter directly. However, if a script is not
installed (that is, you are only using it within your own HP Desk
environment), if you do not have MPE capability you cannot use MPE
commands within that script.
* Special script commands:
Because script files have their own commands, in a way they can be
thought of as a limited programming language, and a very powerful
customization tool. (Note that a script file can also contain
calls to other script files, including recursive calls.) The
types of script commands available fall into three categories:
* Directives
These commands may only be used in script files. They
control the flow of the script and provide other
"programming" type functions. To make these commands
different from normal HP Desk commands they always begin
with an ampersand (&) character, for example, &BACK 6. A
full list of script directives is given in "Directives"
.
* Active functions
Active functions may only be used in script files. They
allow you to use the other types of command in a more
sophisticated way, providing arithmetic and logical
functions, file handling, string handling and parameter and
variable substitution. Active functions are always
enclosed in angled brackets (< >). They return a value to
be used within a command or as input for another active
function. For example, &PRINT <username> will use the
active function <USERNAME> to return the HP Desk user's
name, and by using the directive &PRINT, will print it out
to the screen. A full list of active functions is given in
"Active Functions" .
* Label lines:
These can be branched to, allowing conditional execution of
parts of a script. In other words they provide a "goto"
function. Label lines must always start in column one with
a dollar sign ($) character, for example, $END.
A Quick List of Available Script Commands
Below is a list of the script directives and active functions that are
currently supported by Hewlett-Packard, and a basic description of what
each can be used for. Note that the parameters that any of the commands
may use have not been included here. The chapter Chapter 10 contains
a complete description of each of the script commands and their
parameters.
The commands can basically be divided up into a number of groups
dependent upon their function:
* Script Control--commands which control the flow of the script.
Command - Summary
-----------------------------------------------------------------------------------------
<ACTIVEFN> | forces a string to be scanned to evaluate any active
| functions
&BACK - loops back to a label in the script file
&COMMENT - allows for comments to be added
&ECHO - echoes the processing of the script to the screen
&ERRABORT - stops the script if a syntax error is found
&EXIT - stops the script
&FORWARD - jumps forward to a label in the script
&GOTO - jump to a given line
&HELP - displays help pages
<KEYSET> - returns the number of the function key set
&LABELKEYS - allows you to set specific function key set
&NOECHO - does not echo the processing of the script to the screen
&PAUSE - temporarily stops the processing of a script
&SUSPEND - same as HP Desk SUSPEND
* Input and Output from or to the user--commands which allow scripts
to behave interactively.
Command - Summary
----------------------------------------------------------------------------------------
<ALLDIGITS> - checks to see whether a parameter is numeric
<CHR> - returns an ASCII character
<CLS> - clears the screen
<ESC> - equivalent to the ASCII <chr 27>
&NOCLOSBRAC | allows the use of the "(" character as part of an escape
| sequence in active functions
<NOYES> - checks to see whether the "yes" was returned
<NUMERIC> - checks to see whether a parameter is numeric
<PARM> - returns a parameter
<PARMPRES> - checks to see whether a parameter exists
<PARMREM> - returns parameters from the command line
<PARMTYPE> - returns the type of the parameter
&PRINT - prints to $STDLIST
<PROMPT> - prompts to the user for input
<YESNO> - checks to see whether the "no" was returned
* Variables--commands which allow variables to be used in scripts.
Command - Summary
-----------------------------------------------------------------------------------------
<JCW> - returns the value of a JCW
&LOCALVAR - defines a variable local to the script
&SAVE - saves a variable
<VAR> - returns the contents a variable
<VAREQUAL> - checks to see if two variables are equal in value
<VARLEN> - returns the length of a variable
<VARPOS> - returns the position of one variable inside another
* User information--commands which provide information about the
current user.
Command - Summary
-----------------------------------------------------------------------------------------
<AREA> - returns the number of the current area
<DESIGNATE> - checks to see if the user is working as a designate
<FORMPAC> - checks to see if the user is inside a Forms package
<GROUPNAME> - returns the name of the requested security group
<MEMBER> | checks if the user is a member of the requested security
| group
<NODE> - returns the name of the user's mailnode
<PRINCIPAL> - returns the principal name if working as a designate
<TRAY> - returns the main tray that the user is working in
<USERNAME> - returns the username
<USERNUMBER> - returns the internal user number
* User's environment--commands which either set up or provide
information about a user's environment.
Command - Summary
-----------------------------------------------------------------------------------------
&AB - allows you to set up an abbreviation in the script file
&BREAK - disables/enables use of the BREAK key
&CALLFATHER - forces HP Desk to activate its father process
<DATE> - returns the current date
&DPAGELNGTH - sets the page length when reading lists in the Diary
<INSUSPEND> - checks to see if the user is in suspend mode
<INTERACTIV> - checks to see if the terminal is in interactive mode
<LANGUAGE> - returns the HP Desk internal language number
<MPEACCT> - returns the MPE account name
<MPEGROUP> - returns the MPE group name
<MPEUNAME> - returns the MPE user name
<MPEUSER> - returns the MPE user name
<MPEXL> - checks to see if the processor is an MPE/XL machine
&PAGELENGTH - sets the pagelength when reading lists to terminal
&PATH - defines groups and accounts to be searched for files
<RELATIVEDAY> - returns the relative number of days to a specific date
<TERMNO> - returns the terminal type
<TIME> - returns the current time
<VALIDDATE> | checks to see whether HP Desk can be use the date
| entered
&WHO - lists all users signed onto HP Desk
* Manipulating HP Desk items--commands which allow you to access and
use HP Desk items in a script.
Command - Summary
-----------------------------------------------------------------------------------------
<ATTDATE> | returns the relative date an item was attached to its
| parent
<CHANGEABLE> - checks to see if the item can be changed
<CREATE> | checks to see if a specific item can be created in the
| area
<CREATED> - returns the relative date that the item was created
<CREATOR> - returns the item's creator name
<DELETED> - checks to see if an item had been deleted
<FIND> - returns the next item matching the search criteria
<LAST> - returns the last item number in the area
<REF> | checks whether there is a reference to the specified
| item
<REFNUM> - returns a number referencing the specified item
&SETIT - sets "it" to a specific item
<SUBJECT> - returns the subject of an item
<TYPE> - returns the item type
<TYPENAME> - returns the document type name
* Manipulating MPE files--commands which allow you to access and use
MPE files.
Command - Summary
-----------------------------------------------------------------------------------------
&CLEAROBJ - clears an object store area
<EXISTS> - checks to see if a given MPE file exists
&EXPORT - copies a basic item to an MPE file
&IMPORT - copies from an MPE file
<OBJECTNAME> - returns the name of a file in current object store
&RESTORE - restores a folder from an MPE file
&STORE - stores a folder in an MPE file
<TEXISTS> - checks to see if a specified temporary file exists
<VALIDFNAME> - checks to see if a given filename is valid
* Arithmetic operations--commands which allow mathematical
calculation to be performed in scripts.
Command - Summary
-----------------------------------------------------------------------------------------
<ADD> - adds two values
<EQUAL> - checks whether two parameters are equal
<GREATER> - checks whether one parameter is greater than another
<LESS> - checks whether one parameter is less than another
<MULTIPLY> - multiplies two values
<NUMBERIN> - checks to see whether a number is in a range
<SUBTRACT> - subtracts one value from another
* Logical operations--commands which allow logical comparisons to be
made in scripts.
Command - Summary
-----------------------------------------------------------------------------------------
<AND> - checks whether two parameters are true
<NOT> - checks whether a parameter is true
<OR> - checks whether either parameter is true
* String operations--commands which are used specifically on
strings.
Command - Summary
-----------------------------------------------------------------------------------------
<MAKEQUOTED> - supplies quotes ("")around an unquoted item
<MAKEUNQUOTED> - removes quotes ("")from a quoted item
<NULL> - checks whether the parameter has a null string
<QUOTE> - supplies quotes ("")around any item
<STR> - returns a quoted substring from a string
<STREQUAL> - checks to see whether tow strings are equal
<STRLEN> - returns the length of a string
<STRPOS> - returns the position of a string in another string
<TOKENIN> - checks to see if a string exists in a list of strings
<UNQUOTE> - will remove quotes ("")around any item
<UPSHIFT> - capitalizes all letters in a string
MPE/iX 5.0 Documentation