Thanks for your comments. I will look into both XREF and QREF which I have on
My latest thoughts are that perhaps we can combine the best of both worlds. We
can continue to have default values of zero in the case of locals, while at the
same time give an error if no value is available. Any global variables used
will need to be initialised. Locals do get initialised and so are seen as bona
fide variables. Looking at the SB name table, this is easy to see, even using
SBASIC. Using Turbo toolkit, a "type" function can be defined as ...
DEFine FuNction type(var)
var$ = PARNAM$(1)
END DEFine type
This function returns 2 if var has a value, else zero.
By giving an error, this will trap both spelling mistakes and also variables
accessed out of scope.
QL-Users Mailing List