The @SETSW statement is used to set or reset user and job switches.
Operation | Operands | F mode, L mode |
@SETSW | [ {ON | OFF}=] { [U] int1[-int2] } [,...] |
ON OFF U | The specified switches are set (default value). The specified switches are reset. If If |
int1 int2 | Number of the switch ( All the switches between |
Format 4 of the @IF statement can be used to check whether or not a job switch or user switch is set for the user's own ID.
In a @SETSW statement, it is possible to set or reset both user switches and job switches.
Example 1
@SET #I2 = 6
@SETSW ON = U1-#I2,12-20,U31
User switches 1 to 6 and 31 and job switches 12 to 20 are set.
Example 2
1. @SET #S2 = 'SWITCH 15 IS OFF' 1. @SET #S3 = 'SWITCH 15 IS ON 1. @PROC 9 1. @ @IF ON = 15 : @GOTO 4 --------------------------------------- (1) 2. @ @PRINT #S2 N 3. @ @RETURN 4. @ @PRINT #S3 N 5. @END 1. @SETSW OFF = 15 ----------------------------------------------- (2) 1. @DO 9 --------------------------------------------------------- (3) SWITCH 15 IS OFF 1. @SETSW ON = 15 ------------------------------------------------ (4) 1. @DO 9 --------------------------------------------------------- (5) SWITCH 15 IS ON 1.
(1) | A procedure is stored in work file 9 that outputs the string variable |
(2) | Job switch 15 is reset. |
(3) | The procedure in work file 9 is executed. |
(4) | Job switch 15 is set. |
(5) | The procedure in work file 9 is executed. |