Symisc UnQLite

An Embeddable NoSQL Database Engine



UnQLite C/C++ API Reference - Extract Jx9 Variable.

Syntax

unqlite_value * unqlite_vm_extract_variable(unqlite_vm *pVm,const char *zVarname);


Extract the content of a variable declared inside your Jx9 script.


Description


This routine is used to extract the content of some variable declared inside your Jx9 script which is a very useful way to share information between the host application and the target Jx9 script. After successful return from this routine, you can use the following interfaces to extract the raw content of the variable:


unqlite_value_to_int()

unqlite_value_to_bool()

unqlite_value_to_int64()

unqlite_value_to_double()

unqlite_value_to_string()

unqlite_value_to_resource()


If you want to modify the content of the extracted variable, use the following interfaces:


unqlite_value_int()

unqlite_value_int64()

unqlite_value_bool()

unqlite_value_null()

unqlite_value_double()

unqlite_value_string()

unqlite_value_string_format()

unqlite_value_resource()


This routine must be called after execution of the target Jx9 code. Otherwise, NULL is returned.


Parameters


pVm

A pointer to a unQLite Virtual Machine.

zVarname

A pointer to a null terminated string holding the name of the variable to be extracted.


Return value


Variable content is returned on success. NULL is returned on failure (i.e. variable not declared).


Example


Compile this C file for a smart introduction to this interface.


See also


unqlite_vm_release, unqlite_vm_exec.



Symisc Systems
Copyright © Symisc Systems