v1 version of callstack.
I encourage you to not use this function if you can use the v2 version.
stack := callstack(limit := -1)
limit
– integer: The amount of callstack entries to return.- If
limit
is positive or 0,stack.length()
equalslimit
.
- If
stack
– array of objects: The current callstack (including the call tocallstack()
itself).- Each entry represents one entry in the callstack.
- Each entry is an object. Each object has three keys:
file
– string: The full path of the file the entry of the callstack points to.line
– integer: The line number of the line the entry of the callstack points to.func
– string: The name of the function the entry of the callstack points to.
test1() {
test2()
}
test2() {
test3()
}
test3() {
callstack()
}
strStack := ""
for _, entry in test1() {
strStack .= "Line: " entry["line"] "`nFile: " entry["file"] "`nFunc: " entry["func"] "`n----`n"
}
msgbox, % strStack