Inspect Manual

Using Inspect With TAL and pTAL
Inspect Manual429164-006
13-7
Usage Considerations for TAL Programs
Within a scope, you can access the same index register with the USE and DROP
statements more than once, as long you do not use the same name. In this
example, the name INDEX^REG is assigned to a register more than once in a
scope:
USE index^reg;
FOR index^reg := 1 TO 10 DO
X[index^reg] := index^reg;
DROP index^reg;
...
USE index^reg;
If you attempt to display or modify INDEX^REG, Inspect displays this error message:
You cannot further qualify the index register.
Examples
Given a TAL procedure named TPROC that contains INT T^INT and subprocedure
TSUB, which in turn contains INT T^SUBINT, examples of data locations are:
This example assumes a current scope path of #TPROC:
The example on the following page uses a stack TRACE to illustrate this behavior in
subprocedures. Also notice that even though the subprocedure has parameters,
Inspect cannot display them.
-C20FOBJ2-TRACE
Num Lang Location
TAL .SUB_SCOPE_N: #SCOPE_N.#37(C20FTALK)
0 TAL #SCOPE_N.#25(C20FTALL)
1 TAL #C20FTAL2.#8(C20FTALP)
-C20FOBJ2-SOURCE
#33
#34 sub_scope_early:
#35 ! get current value of interval timer:
#36 !
*#37 call timestamp (time);
#38 !
#39 ! convert the time
#40 !
#41 sub_scope_middle: call contime (date^time, time,
#42 time[1], time[2]);
** Inspect error 98 ** Qualification required to resolve
ambiguous reference: identifier
Data Location Specifies
#TPROC.T^INT The most recent instance of T^INT.
#TPROC(-1).T^INT The second-most recent instance of T^INT.
#TPROC(1).T^INT The oldest (first) instance of T^INT.
Data Location Specifies
TSUB.T^SUBINT The current instance of T^SUBINT. Note that you cannot refer to
instances of variables in subprocedures.