@IFNUM
|
Where
starting_number is an integer constant with a value from 1 to 4095.
Function
The @IFNUM control statement specifies the number of the first input (WHEN=IN) or output (WHEN=OUT) IF statement generated by the STL Translator. When this statement is coded in an STL program, generated IF statements will be assigned numbers beginning with starting_number up to a maximum of 4095.
This statement is valid only when coded outside of an STL procedure.
Examples
@ifnum = 30 /* Begin IF numbering with 30. */
Note
You should code the @IFNUM control
statement only under these conditions:
- You are trying to coordinate procedures in multiple STL programs.
/* Program #1 */ @program = prog1 proc1: msgtxt /***********************************************************/ /* WSim code generated for this program will begin with IF */ /* number 1. This is the default. PROC2 is called in */ /* this program but is not included in this program. */ /* You must be careful to coordinate IF numbering in */ /* such cases. */ /***********************************************************/ onin substr(ru,1,5) = 'Hello' then ready = on call proc2 endtxt @endprogram/* Program #2 */ @program = prog2 @ifnum = 20 proc2: msgtxt /***********************************************************/ /* WSim code generated for this program will begin with IF */ /* number 20. This is caused by the @IFNUM control state- */ /* ment. This statement is needed because PROC2 is */ /* called by a procedure that is not included in this */ /* program. */ /***********************************************************/ onin substr(ru,1,7) = 'Goodbye' then ready=off . . . endtxt @endprogram - You want to generate IF statements using the @GENERATE STL statement
and need to reserve one or more IF numbers for your own use.
@ifnum = 11 proc1: msgtxt /***********************************************/ /* Set aside IF numbers 0-10 for use in */ /* code created by using @GENERATE */ /* statements. */ /***********************************************/ /* Generate special IFs. */ @generate "0 IF WHEN=IN,LOC=RH+0,TEXT='80',THEN=B-RESP,STATUS=HOLD" . . . "10 IF WHEN=IN,LOC=B+0,TEXT=(REPLY 1),THEN=CONT" @endgenerate . . . endtxt - You exceeded the number of IFs and can reuse earlier IF numbers. You must be very careful when doing this to ensure that you do not override something you still need.