Retrieves the current callstack.
A v1 version for this exists here. I advise you to not use it if you can.
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 maps: The current callstack (including the call tocallstack()
itself).- Each entry represents one entry in the callstack.
- Each entry is a map. Each map 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"] "`n"
"File: " entry["file"] "`n"
"Func: " entry["func"] "`n"
"----`n"
)
}
msgbox strStack