The "Variable_Register()" function is used to register your static variables with sliceOmatic. The function return the number of variables you want to register and a pointer to the names of these variables.
Syntax
extern "C" __declspec(dllexport) int Variable_Register(
char ***name
)
Parameters
name
This function receive a pointer where it will store an array of text strings. One string per variable to register.
Return value
The function returns the number of registered variables.
Remarks
This function is optional. If you do not have any variables to register, you can omit it.
Requirements
Header:
sliceO_include.hpp
Library:
sliceO_Structures.lib
Example
In this sample function, we register 4 variables, "$DEMO_VAR_USHORT", "$DEMO_VAR_FLOAT", "$DEMO_VAR_STRING", "$DEMO_VAR_POINTER".
|
...
// ----------------------------------------------------------------------------
//
// Function: Variable_Register
//
// Parameters: name (char ***) Pointer to a list of name for the variables
// Returns: (int) Number of variable to register.
//
// This function will tell the command line parser to look for your
// variables. Any command action on these variable (read or write)
// will generate a callback to the Variable_Get function.
//
// ----------------------------------------------------------------------------
extern "C" __declspec(dllexport) int Variable_Register( char ***name )
{
static char *ret[] = { "$DEMO_VAR_USHORT",
"$DEMO_VAR_FLOAT",
"$DEMO_VAR_STRING",
"$DEMO_VAR_POINTER"
} ;
(*name) = ret ;
return( sizeof(ret) / sizeof(char *) ) ;
}
...
|
|
See also
Variable_Get
Fct_Variable_Get
Fct_Variable_Value