14 2 1 CMP_IDX Examples

LANSA Technical

14.2.1 @@CMP_IDX Examples

The following examples apply to the @@CMP_IDX command.

Example 1: Compare index CF with the maximum file chosen. If greater than the maximum file number then transfer control to label LB1.

@@CMP_IDX IDX_NAME(CF) IDX_VALUE(@@TFMX) IF_GT(LB1)

 

Example 2: Compare index AB with the literal 10. If equal to 10 then transfer control to label A25.

@@CMP_IDX IDX_NAME(AB) IDX_VALUE(10) IF_EQ(A25)

 

Example 3: Compare index NE with the number of elements in list number 01. If greater than this value then transfer control to label X10.

@@CMP_IDX IDX_NAME(NE) IDX_VALUE(@@LNE01) IF_GT(X10)