sq_setfreevariable

Squirrel 2.2

sq_setfreevariable

SQRESULT sq_setfreevariable(HSQUIRRELVM v, SQInteger idx, SQInteger nval);

pops a value from the stack and sets it as free variable of the closure at the position idx in the stack.

parameters:
HSQUIRRELVM v

the target VM

SQInteger idx

index of the target object in the stack

SQInteger nval

0 based index of the free variable(relative to the closure).

return:

a SQRESULT