All the heavy lifting can be done with the $STACK() function. Here is a start:
ZTEST ; SRS 2025-08-07
DO A
QUIT
A DO B
QUIT
B DO C
QUIT
C DO D
QUIT
D DO STACK
QUIT
STACK NEW
FOR i=0:1:$STACK(-1)-1 {
SET s=$STACK(i,"PLACE")
SET retloc=$PIECE(s," ")
TRY { SET code=$TEXT(@retloc) } CATCH { SET code="n/a" }
WRITE !,retloc," (",$PIECE(s," ",2),") -> ",code
}
QUIT- Log in to post comments