sq_getlocal

Squirrel 3.0

sq_getlocal

const SQChar * sq_getlocal(HSQUIRRELVM v, SQUnsignedInteger level, SQUnsignedInteger nseq);

Returns the name of a local variable given stackframe and sequence in the stack and pushes is current value. Free variables are treated as local variables, by sq_getlocal(), and will be returned as they would be at the base of the stack, just before the real local variables.

parameters:
HSQUIRRELVM v

the target VM

SQUnsignedInteger level

the function index in the calls stack, 0 is the current function

SQUnsignedInteger nseq

the index of the local variable in the stack frame (0 is ‘this’)

return:

the name of the local variable if a variable exists at the given level/seq otherwise NULL.