Debugger Functions
These functions are useful when developing and troubleshooting scripts. They require a debugger to be attached to the scripting engine to have full effect.
Debug
Debug(Value)
Sends Value as a message to the attached debugger. Has no effect if no debugger is attached.
Returns: Boolean (True if a debugger is attached, otherwise False)
Examples:
Debug("Starting calculation")
Debug("x = " & x)
Debug(result)
SetTrace
SetTrace(OnOff)
Enables or disables script tracing. When tracing is enabled, the debugger receives a message for each script line as it executes.
| Parameter | Description |
|---|---|
OnOff |
True to enable tracing, False to disable |
Returns: Boolean
Examples:
SetTrace(True)
' ... script lines ...
SetTrace(False)
GetFunctionList
GetFunctionList()
Returns a sorted array of all function signatures registered in the scripting engine, including any user-defined functions. Useful for discovering what is available at runtime.
Returns: String() (sorted array of function definition strings)
Examples:
Dim fns = GetFunctionList()
For i = 0 To Len(fns) - 1
Debug(fns(i))
Next