Use IF...THEN when you want the login script to perform an action only under certain conditions.
IF...THEN has the following command format:
IF
conditional [AND|OR
[conditional]] THEN
commands [ELSE
command]
[END]
Replace conditional with identifier variables. For more information about identifier variables, see ``Identifier variables''.
Replace commands with any login script commands that you want to be executed if the specified condition is true.
Follow these guidelines for using IF...THEN:
An example of a conditional statement is
IF MEMBER OF "CLERKS"In this statement, some action is performed if the user who logged in belongs to the Group object named CLERKS.
The following is a different type of conditional statement:
IF DAY_OF_WEEK="MONDAY"In this statement, the equals sign ``='' indicates the relationship between the variable DAY_OF_WEEK and its value (Monday). Note that the value (Monday) is inside quotation marks.
IF DAY_OF_WEEK="MONDAY" THEN WRITE "Status report is due today" ELSE WRITE "Have a nice day!" END
IF HOUR24>="12" THEN WRITE "afternoon" END
IF NDAY_OF_WEEK="4" THEN #CAPTURE Q=FAST_Q NB TI=10 NFF END
IF DAY_OF_WEEK="MONDAY" THEN MAP *6:=VOL1:APPL\WP IF MEMBER OF CLERKS THEN WRITE "Your report is due immediately!" END END
The first line of the following IF...THEN statement is a compound conditional that means ``If it is the evening of the first day of the month'':
IF GREETING_TIME="EVENING" AND DAY="01" THEN WRITE "The system will be backed up tonight." ENDThe following line is a compound conditional that means ``If it is 11:59:59 p.m''.
IF HOUR24="23" AND MINUTE="59" AND SECOND="59"
The following example shows two commands that are executed on Tuesdays: a WRITE command that displays a message about a staff meeting, and an INCLUDE command that tells the login script to process any commands or messages contained in the file SYS:PUBLIC\UPDATE.
IF DAY_OF_WEEK="TUESDAY" THEN WRITE "Staff meeting today at 10 a.m." INCLUDE SYS:PUBLIC\UPDATE END