$oKix=GetObject("KiXtart.Interpreter")
If Not $oKix.Features("IsDeclared()")
"Sorry, this script requires IsDeclared() to work correctly"+@CRLF
Exit 1
EndIf
For Each $oVariable in $oKix.Globals
"Global variable "+$oVariable.Name+" = '"$oVariable.Value+@CRLF
Next
For Each $oVariable in $oKix.Locals
"Local variable "+$oVariable.Name+" = '"$oVariable.Value+@CRLF
Next
For Each $oUDF in $oKix.UDF
"Defined UDFs "+$oUDF.Name+@CRLF
For Each $oParameter in $oUDF.Parameters
; Note, parameter will only have a value when inside the actual UDF.
"Parameter: "+$oParameter.Name+" value='"+$oParameter.Value+"' "+IIf($oParameter.Optional,"(optional)","(mandatory)")+@CRLF
Next
Next
For Each $oFD in $oKix.FileDescriptors
"File descriptor "+$oFD.Name+" is "
If $oFD.mode>=0
"in use, mode is "+$oFD.mode+" file path is '"+$oFD.Path
Else
"not in use."
EndIf
@CRLF
Next
"Currently executing line # "+$oKix.CurrentLine+@CRLF
myFunction()
Function myFunction()
Debug("Testing return stack enumeration")
EndFunction
Function Debug($s)
"DEBUG: "+$s"+@CRLF
" Return Stack:"+@CRLF
For Each $oReturn in $oKix.ReturnStack
" Calling entity: "+$oReturnStack.name+", line #"+$oReturnStack.line"+@CRLF
Next
EndFunction