How can I correlate fixed-form branching commands GO END and GO NEXT REQUEST to ASL syntax?

Document ID : KB000025356
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

How can I correlate fixed-form branching commands GO END and GO NEXT REQUEST to ASL syntax?

Answer:

If you are familiar with the fixed-form branching commands, finding the exact equivalent to some like GO END and GO NEXT REQUEST in ASL may require a change in thinking.

ASL was designed with structured programming in mind. Hence, branches are controlled. If you are familiar with the fixed-form branching commands, finding the exact equivalent in ASL might require a change in thinking. GO REQUEST requestname translates simply to CALL type requestname, but branching to other logic points such as GO END and GO NEXT REQUEST are a little different.

If the intent is to exit the current process, and continue with the next segment occurrence within a loop as one would have used a fixed format GO END, the ASL equivalent is CONTINUE. (See page 4-27 of the ASL Reference Guide.)

To get to the next PROCEDURE, where you would use a fixed format GO NEXT REQUEST, use RETURN and a series of CALL statements such as

MAIN: 
CALL PROC REQ1 << use RETURN in REQ1 to get back here CALL PROC REQ2 << then invoke REQ2
REQ1: PROC TYPE SUBROUTINE IF . . . . . . process . . . RETURN ELSE . . . process . . . RETURN END IF END REQ2: PROC TYPE SUBROUTINE
. . . process . . .
END

(See page 4-16 of the ASL Reference Guide.)

Refer to Appendix B of the ASL Reference Guide to get fixed format relationship to all the ASL procedural commands.