Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PL/I
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===GO TO with a non-fixed target=== PL/I has counterparts for COBOL and FORTRAN's specialized GO TO statements. Syntax for both COBOL and FORTRAN exist for coding two special two types of {{mono|GO TO}}, each of which has a target that is not always the same. * {{tt|ALTER}} (COBOL), {{tt|ASSIGN}} (FORTRAN): ** {{code|ALTER paragraph_name_xxx TO PROCEED TO para_name_zzz|cobolfree}} (“altered go to”).<ref name=COB.IBM>{{cite web |url=https://www.ibm.com/support/knowledgecenter/en/SS6SG3_4.2.0/com.ibm.entcobol.doc_4.2/PGandLR/ref/rlpsalte.htm |title=ALTER statement|website=[[IBM]] |date=24 September 2021}}</ref> **: There are other/helpful restrictions on these, especially "in programs ... {{tt|RECURSIVE}} attribute, in methods, or .. {{tt|THREAD}} option."<ref name=COB.IBM/> ** {{code|ASSIGN 1860 TO IGOTTAGO|fortran}} (“assigned go to”)<ref name=ONLY2THESE>{{cite web |url=https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn9j/index.html |title=GO TO (Assigned)}}</ref><br />{{code|GO TO IGOTTAGO}} **: One enhancement, which adds built-in documentation, is {{code|GO TO IGOTTAGO (1860, 1914, 1939)}} **:: (which restricts the variable's value to "one of the labels in the list.")<ref name=ONLY2THESE/> * {{tt|GO TO}} ... based on a variable's subscript-like value. ** {{code|GO TO (1914, 1939, 2140), MYCHOICE}} (“computed go to”)<ref>{{cite web |url=https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn9l/index.html |title=GO TO (Computed)}}</ref> ** {{code|GO TO para_One para_Two para_Three DEPENDING ON IDECIDE|cobol}} (“go to depending on”).<ref>{{cite web |url=https://www.tutorialride.com/cobol/go-to-statement-in-cobol.htm |title=GO TO Statement in COBOL}}</ref> PL/I has statement label variables (with the {{tt|LABEL}} attribute), which can store the value of a statement label, and later be used in a {{tt|GOTO}} statement.<ref>{{cite book |title=Digital Research PL/I Language Programmer's Guide |page=103}}</ref><ref name="gc33-0009-4"/>{{rp|54}}<ref name="gc33-0009-4"/>{{rp|23}} <pre> LABL1: .... . . LABL2: ... . . . MY_DEST = LABL1; . GO TO MY_DEST; </pre> The programmer can also create an array of static label constants by subscripting the statement labels. GO TO HERE(LUCKY_NUMBER); /* minus 1, zero, or ... */ HERE(-1): PUT LIST ("I O U"); GO TO Lottery; HERE(0): PUT LIST ("No Cash"); GO TO Lottery; HERE(1): PUT LIST ("Dollar Bill"); GO TO Lottery; HERE(2): PUT LIST ("TWO DOLLARS"); GO TO Lottery; Statement label variables can be passed to called procedures, and used to return to a different statement in the calling routine.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
PL/I
(section)
Add topic