Please enable JavaScript to view this site.

A-Shell Reference

++IFMAP <variable>

   ...

{++ELIFMAP <label>

   ...}

++ENDIF

or

++IFNMAP <variable>

   ...

{++ELIFMAP <variable>

   ...}

++ENDIF

These conditionals may be used to conditionally compile sections of code based on whether a specified variable has been mapped. For example:

++IFMAP WORK'VARS

    <work statements>

++ELIFMAP PLAY'VARS

    <play statements>

++ELSE

    MAP1 WORK'VARS

        MAP2 JOB$,S,10

    MAP1 PLAY'VARS

        MAP2 GAME$,S,10

++ENDIF

 

Note that even when used within a ++INCLUDE file, or a procedure/function, the variable name evaluated by the conditional is treated as global, and thus will not work as expected if the variable you are referring to was defined privately or locally. For example, both of the following conditions will act based on whether the specified variable has been previously mapped globally, even though you may be expecting otherwise:

++IFNMAP Module_Private_Var

    PRIVATE MAP1 Module_Private_Var,B,1

++ENDIF

 

Procedure Test()

    ++IFNMAP FLAG

        MAP1 FLAG,B,1

    ++ENDIF

...

EndProcedure

 

This is because private variables (and local variables) are defined in separate areas relative to their scope, but the conditional statements have no good way of knowing which context you are referring to, and checking multiple contexts would introduce another layer of confusion, so they always refer to the global context.