Scope modifiers: Difference between revisions

Content added Content deleted
m ({{out}})
m (→‎{{header|REXX}}: changed the REXX section header.)
Line 992: Line 992:


=={{header|REXX}}==
=={{header|REXX}}==
In the REXX language, all variables are local, and only within PROCEDUREs are variables local (private), except
In the REXX language, all variables are global, and only within PROCEDUREs are variables local (private), except for those identified
<br>for those identified via the EXPOSE option. There is a variant where the EXPOSE can have a list specified.
<br>via the &nbsp; '''expose''' &nbsp; option. &nbsp; There is a variant where the &nbsp; '''expose''' &nbsp; can have a list specified (along with variables and stems).

<br>Any REXX variables in an external routine (program) aren't known.
Any REXX variables in an external routine (program) aren't known.
<br>Note: the R4 REXX interpreter has an '''EXPOSEALL''' option that allows an external REXX subroutine to access the caller's local variables.

<br>There is a mechanism that allows external programs to access local REXX variables and is essentially restricted to
Note: the R4 REXX interpreter has an &nbsp; '''exposeall''' &nbsp; option that allows an external REXX subroutine to access the caller's local variables.
<br>assembler programs that use the REXXAPI interface.
<br>There is a mechanism that allows external programs to access local REXX variables and is essentially restricted to assembler programs
<br>All labels (names of subroutines/functions/procedures) are global.
<br>(or other programs) that use the REXXAPI interface.
<br>If more than one identical label is specified, only the first label is recognized (and not considered an error).

All labels (names of subroutines/functions/procedures) are global, regardless of procedures.

If more than one identical label is specified, only the first label is recognized (and it isn't considered an error).
<lang rexx>/*REXX program to display scope modifiers (for subroutines/functions). */
<lang rexx>/*REXX program to display scope modifiers (for subroutines/functions). */
a=1/4
a=1/4