追加規則

配列 *IN、配列要素 *IN(xx)、またはフィールド *INxx を処理する場合には 、次の規則に留意してください。
  • これらのフィールドのいずれかに文字 '0' (ゼロ) または *OFF を 転送した場合には、対応する標識がオフに設定されます。
  • これらのフィールドのいずれかに文字 '1' または *ON を転送した場 合には、対応する標識がオンに設定されます。
  • *INxx に転送する値は '0' (ゼロ) または '1' だけにして ください。 それ以外の値を転送した場合には、その後の通常の RPG IV 標識テストが予期できない結果を生ずることがあります。
  • *IN、*IN01 から *IN99、または *IN(索引) のアドレスを使用 する場合は、標識 *IN01 から *IN99 が定義されることになります。それ以外の、*INLR あるいは *INL1 などの標識のアドレスを使用する場合は、その標識だけが定義されることになります。

データとして参照される標識の例については、図 1 を参照し てください。

図 1. データとして参照される標識の例
*...1....+....2....+....3....+....4....+....5....+....6....+....7...
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq..
 *
 *  When this program is called, a single parameter is passed to
 *  control some logic in the program.  The parameter sets the value
 *  of indicator 50.  The parameter must be passed with a character
 *  value of 1 or 0.
 *
C     *ENTRY        PLIST
C     *IN50         PARM                    SWITCH            1
 *
 *
 *  Subroutine SUB1 uses indicators 61 through 68.  Before the
 *  subroutine is processed, the status of these indicators used in
 *  the mainline program is saved.  (Assume that the indicators are
 *  set off in the beginning of the subroutine.)  After the subroutine
 *  is processed, the indicators are returned to their original state.
 *
 *
C                   MOVEA     *IN(61)        SAV8             8
C                   EXSR      SUB1
C                   MOVEA     SAV8          *IN(61)
 *
 *  A code field (CODE) contains a numeric value of 1 to 5 and is
 *  used to set indicators 71 through 75.  The five indicators are set
 *  off.  Field X is calculated as 70 plus the CODE field.  Field X is
 *  then used as the index into the array *IN.  Different subroutines
 *  are then used based on the status of indicators 71 through 75.
 *
C                   MOVEA     '00000'       *IN(71)
C   70              ADD       CODE          X                 3 0
C                   MOVE      *ON           *IN(X)
C   71              EXSR      CODE1
C   72              EXSR      CODE2
C   73              EXSR      CODE3
C   74              EXSR      CODE4
C   75              EXSR      CODE5