Please enable JavaScript to view this site.

A-Shell Reference

Added April 2014

++IFLBL <label>

   ...

{++ELIFLBL <label>

   ...}

++ENDIF

or

++IFNLBL <label>

   ...

{++ELIFLBL <label>

   ...}

++ENDIF

These are analogous to the existing ++IFDEF, ++IFNDEF, and ++ELIFDEF statements, as well as ++IFMAP, ++IFNMAP and ++ELIFMAP, except that instead of referring to defined symbols or mapped variables, they refer to labels—used by GOTO and GOSUB—as well as procedure and function names. Note however that when the specified label is meant to refer to a function or procedure name, it must be terminated by an empty pair of parentheses. For example:

++IFLBL MAIN

    ++MESSAGE The label MAIN is defined

++ELIFLBL MAIN()

    ++MESSAGE The procedure MAIN() is defined

++ELIF fn'main()

    ++MESSAGE The function fn'main() is defined

++ENDIF

 

If the label referenced is actually an alias defined with DEFALIAS, then the alias is evaluated first—i.e. converted to the actual target label—before the ++IFLBL expression is evaluated.

As with the ++IFDEF and ++IFMAP directives, the ++IFLBL directives operate on whether the referenced label has been seen yet by the compiler in the current pass. Advance knowledge of function definitions gleaned from the preliminary (/p or /px) compilation pass does not affect ++IFLBL evaluation.

Also note that labels, like variable names, are case sensitive, unless you compile with the /CI switch.

See Also

++IFDEF, ++IFNDEF, ++ELIFDEF for notes on how DEFALIAS definitions are handled by both types of directives.

History

2022 June, A-Shell 6.4.1717, compiler edit 994:  ++IFLBL / ++IFNLBL now recognize DEFALIAS'd function and procedure labels, acting based on the existence of the target function / procedure and not the existence of the DEFALIAS definition.

2014 April, A-Shell 6.1.1382, compiler edit 655:  add all three statements to A-Shell