Previous Topic Next topic Print topic


Line Number and Statement Offsets

A line number offset can be used to locate a statement when it is not labeled or its source line number is unknown. A line number offset is formed by placing a plus character (+) followed by a positive integer after a source line number or a statement label. For example, line 15 in the example below can be referred to by the program as 11 + 4 or as CHKPAGE + 4. Of course, 15 + 0 refers to the same line.

 9:  DUMMY
10:  %INCLUDE 'MYFILE.PL1';/*PL/I sample */
11:  CHKPAGE:
12:  if I = 66 then 
13:        do; put skip; I = 0; goto DONEIT;
14:  end;
15:  I = I + 1; DONEIT: J = 0; K = 0;
16:  L = 0;

A statement offset must be used to refer to an unlabeled statement that is not the first statement on a line. A statement offset is formed by placing a period followed by a positive integer (indicating the number of statements from the beginning of the line) after the line number offset. (If the line number offset equals zero, a plus character must be used.) For example, the K = 0 statement on line 15 of the example above can be referred to by the debugger as 15 + 0.2 or CHKPAGE + 4.2.

Previous Topic Next topic Print topic