HP 3000 Manuals

Checking an Item Exists [ HP DeskManager Customization ] MPE/iX 5.0 Documentation


HP DeskManager Customization

Checking an Item Exists 

So far, this has only shown us how HP Desk commands can be used in
scripts.  We can now look at ways in which our first example of a script
(to send a message) can be made more sophisticated and useful by the
addition of instructions other than HP Desk commands.

How can the script be made to cope when the item you want to mail does
not exist?

     &FORWARD itemok <REF "Weekly Status Report">
     &PRINT I don't think you have created the report yet
     &EXIT
     $itemok Come here if the item is OK
     SEND "Weekly Status Report" to Mary Smith / ACCTS/01
     ACKNOWLEDGE 4
     URGENT
     MAIL
     &EXIT

&FORWARD will cause a jump in the script file to the label $itemok if REF
(which means "is this a valid reference to an item?") is true.  If REF is
false the script carries on to the next statement.  This is assuming that
you are in the correct area of HP Desk--which is one thing that you
should always check.

Jumps and labels, when they are used with other script features such as
conditions and variables (see later) can be used to make your script
files more like a programming language, as you can create conditional
loops.

Notice that you can add a comment on the same line as a label.  A space
denotes the end of a label and anything following the space is treated as
a comment.  Labels can be up to 16 alphanumeric characters.



MPE/iX 5.0 Documentation