Content deleted Content added
m Disambiguate Encode to Code using popups; removed cite to Wikipedia article; formatting: 7x whitespace, 6x nbsp-dash (using Advisor.js) |
Peter Flass (talk | contribs) PL/I example |
||
Line 101:
jump_table[value]();
}
</source>
==Jump table example in PL/I==
[[PL/I]] implements a jump table as an ''array of label variables''. These may be initialized in an unusual way by using a subscripted statement label. PL/I label variables are not simply the address of the statement, but usually contain additional information on the state of the code block to which they belong.
<source lang=PLI>
declare lab (10) label;
declare x fixed binary;
goto lab(x);
lab(1): /* code for choice 1 */ ;
...
lab(2): /* code for choice 2 */ ;
...
</source>
|