Lesson 3: IF [ MPE V to MPE XL: Getting Started ] MPE/iX 5.0 Documentation
MPE V to MPE XL: Getting Started
Lesson 3: IF
The IF (...ENDIF) command has been modified in MPE XL to allow for
expression evaluation, and it now also supports ELSEIF.
Consider the following command file:
IF LFT (HPDATEF,3) = "MON" THEN
ECHO Reminder--Staff Meeting at 11:00
ELSEIF LFT (HPDATEF,3) = "THU" THEN
ECHO Reminder--Weekly Dept. Meeting at 9:30
ELSE
ECHO Have a nice day!
ENDIF
In the example above, if it is Monday (the first three letters of HPDATEF
= MON), Reminder...Staff Meeting at 11:00 will echo to the screen; if it
is Thursday (the first three letters of HPDATEF = THU), the reminder of
the 9:30 meeting will appear; and if it is any other day of the week,
Have a nice day! is printed on the screen.
Exercise
5. Using the IF command, write a logon UDC that reminds you to do
something every other day. HINT: use (HPDAY MOD 2).
MPE/iX 5.0 Documentation