@Peter,
the list variables topic is a bit confusing for me:
some variables show up as variables but also as formal parameters from the SUB declaration and some show up as DIM and LOCAL ....
attached is my test program
'
OPTION EXPLICIT
OPTION DEFAULT NONE
dim string main_a, Main_b, Main_out_str(20)
dim integer main_idx, main_f_nbr, main_c
print "---- on MAIN 1 -----"
list variables
call "sub_1", main_a, main_out_str(), main_f_nbr
print "---- on MAIN 2 -----"
list variables
end
sub sub_1 (formal_in_str as string, formal_out_str() as string, formal_fld_nbr as integer)
static integer sub_static_1, sub_static_2
local integer sub_local
print "---- in SUB --------"
list variables
end sub
and the output
RUN
---- on MAIN 1 -----
DIM INTEGER MAIN_C
DIM INTEGER MAIN_F_NBR
DIM INTEGER MAIN_IDX
DIM STRING MAIN_A
DIM STRING MAIN_B
DIM STRING MAIN_OUT_STR(20)
---- in SUB --------
DIM INTEGER MAIN_C
DIM INTEGER MAIN_F_NBR
DIM INTEGER MAIN_IDX
DIM INTEGER SUB_1SUB_STATIC_1
DIM INTEGER SUB_1SUB_STATIC_2
DIM STRING MAIN_A
DIM STRING MAIN_B
DIM STRING MAIN_OUT_STR(20)
LOCAL INTEGER FORMAL_FLD_NBR
LOCAL INTEGER SUB_LOCAL
LOCAL INTEGER SUB_STATIC_1
LOCAL INTEGER SUB_STATIC_2
LOCAL STRING FORMAL_IN_STR
LOCAL STRING FORMAL_OUT_STR(20)
---- on MAIN 2 -----
DIM INTEGER MAIN_C
DIM INTEGER MAIN_F_NBR
DIM INTEGER MAIN_IDX
DIM INTEGER SUB_1SUB_STATIC_1
DIM INTEGER SUB_1SUB_STATIC_2
DIM STRING MAIN_A
DIM STRING MAIN_B
DIM STRING MAIN_OUT_STR(20)
>
e.g.
- LOCAL STRING FORMAL_OUT_STR(20) is the same as DIM STRING MAIN_OUT_STR(20)
-the attribute STATIC is not present, instead it seems to be DIM
DIM INTEGER SUB_1SUB_STATIC_1
or LOCAL
LOCAL INTEGER SUB_STATIC_1
depending on the actual scope of list variables.
Gerald