engine_getvar (char* name, long* type)

 LC  Returns the pointer to a lite-C struct or variable of the current script. Can be used for real time debugging.

Parameters:

name - name of the variable or struct.
type - pointer to a long variable that is set to the type of the variable: VAR_STRUCT (0), VAR_CHAR (1), VAR_SHORT (2), VAR_FIXED (3), VAR_LONG (4), VAR_FLOAT (5), VAR_DOUBLE (7). Structs and arrays set a type of 0. If it's a pointer, VAR_POINTER (16) is added.

Returns:

void* pointer to the variable, or NULL when the variable doesn't exist.

Example:

long type;
void* varptr = engine_getvar("MyVar",&type);

See also:

engine_open, engine_getvarinfo

► latest version online