TAL Programmer's Guide
Declaring Subprocedures
Structuring Programs
3–12 096254 Tandem Computers Incorporated
Sublocal Data Sublocal data is data you declare inside a subprocedure and can access only from
within the same subprocedure. Sublocal data can be any data item described in
Table 3-1 earlier in this section. Within a subprocedure, all sublocal data declarations
must appear before any sublocal statements. Also, sublocal arrays and structures must
be directly addressed. (Addressing is explained in Section 4, “Introducing the
Environment.”) Following is an example of how you declare sublocal data:
PROC myproc;
BEGIN
!Local data declarations
SUBPROC mysub;
BEGIN
INT var1; !Sublocal data declarations
INT var2;
var1 := var1 - var2; !Sublocal statement
END;
!Local statements
END;
Sublocal Labels You declare sublocal labels as you do local labels, except that you declare sublocal
labels within a subprocedure. You can access sublocal labels from anywhere within
the encompassing subprocedure.
Sublocal Statements Within a subprocedure, you can specify any statement described in Table 3-2 earlier in
this section. Sublocal statements can access:
Global identifiers, including procedures, anywhere in the program
Local identifiers, including subprocedures, in the encompassing procedure
Sublocal identifiers in the encompassing subprocedure