Menu

scScript Show Package

Show provides provides data display functions for development and debugging.

Functions:
Vars
X = Show.Vars(Flag)(V1, V2);
Writes details of out vars (V1, V2, etc) to *Output*, then returns Int 1.
Flag determines detail level, defaults to #Low.
If no vars, will display all locals in current function run.
Local var names are currently NOT stored, so labels var categories. NOTE: +++
Globs
X = Show.Globs(Flag);
Writes details of all globals to *Output*, then returns int 1.
Flag determines detail level, defaults to #Low.
Run
X = Show.Run(Flag);
Writes details of current Run record to *Output*, then returns int 1.
Flag determines detail level, defaults to #Low.
Script
X = Show.Script(F1);
X = Show.Script(F1, F2);
Writes details of current Script to *Output*, then returns int 1.
F1 determines detail level of the script, defaults to #low.
If F2 is given and called from a sub-script, then superiors are shown.
VM
X = Show.VM();
Writes details of VM, all memory slabs, loaded packages, defined C functions,
Run Stack, and even the current Script(s) to *Output*, then returns int 1.
Mem
X = Show.Mem(T);
X = Show.Mem(T, O);
Writes details of T (Type) memory slabs to *Output*, then returns int 1.
If given O (Ord) will show only that slab for the specified Type, otherwise
defaults to Ord 0 which means all. (T and O match numbers in Show.VM.)
VMStrs
X = Show.VMStrs();
Writes details of the main string hash table (stored in STab) and every stored
string to *Output*, then returns int 1.
Strs
X = Show.Strs();
Writes every string indexed by the compiler to *Output*, then returns int 1.
Note: VMStrs will show many other strings NOT used by this script!
Pkg
X = Show.Pkg(Id);
X = Show.Pkg(Name);
Writes details of the specified Pkg to *Output* then returns 1.
Pkg can be specified by Id (int) or Name (str).
If Id is negative or missing, all pkgs will be detailed.

Defs:
Display level flags #Min, #Low, #High, #Max

Note: Various displays will show (Ref:1) if SC_GC_REFCOUNT compile flag is 0, as the RefCount field is still there, just no longer counted or used for purging memory.

+++ The main body of the script is also a function, albeit one that is implicitly called. It will not have any in or out formal parameters but usually has multiple Registers and may also have Local variables. The latter are defined in {} sub-blocks of the main script and are hoisted to the top.