Fct_Variable_Value

 

Get the value of a system variable.

 

 

Syntax

 

void * Fct_Variable_Value(

          char *name,

          int *size=NULL,

          unsigned short *type=NULL,

          int (**update)(void)=NULL

) ;

 

 

Parameters

 

name

"name" is a pointer to a character string containing the name of the desired variable.  Variable names are upper cases and start with "$"

 

size

If present, the "size" argument will get the number of elements in your variable if it is an array, or 1 otherwise.

 

type

If present, the "type" argument will get the type type of the variable.  The supported types are:

 

 

VARIABLE_CHAR

VARIABLE_SHORT

VARIABLE_INT

VARIABLE_FLOAT

VARIABLE_DOUBLE

VARIABLE_LONG

VARIABLE_VECT

VARIABLE_COLOR

VARIABLE_STRING

VARIABLE_POINTER

 

//  8 bit

// 16 bit

// 32 bit

// 32 bit

// 64 bit

// 64 bit

// x,y,z

// 32 bit RGB

// NULL terminated string of characters

 

The following modifiers can also be appended to the types:

 

VARIABLE_UNSIGNED

VARIABLE_ARRAY          

VARIABLE_UNLISTED

VARIABLE_READ_ONLY

// Only for CHAR, SHORT and INT types

 

// can not be access through the interface

// variable can only be accesses through the Fct_Variable_Value function.

 

The "type" of a variable can be an "or" of multiple values from the table.  For example, is your variable is an array of unsigned shorts you use:

*type = VARIABLE_ARRAY | VARIABLE_UNSIGNED | VARIABLE_SHORT ;

 

 

update

"Update" is a pointer to an update function. When the variable is modified by an external source, this function is called. If changing the value of the variable change something in your module, you can use this function to make the appropriate changes.

 

 

Return value

 

This function return the value of a desired variable or NULL if it failed to locate the variable.

 

 

Remarks

 

FLOAT, DOUBLE and LONG variable are only available through the "Fct_Variable_Get" function.

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

 

Library:

          sliceO_Structures.lib

 

 

 

Example

 

From the edit_image_fct.cpp file

 

 

See also

 

Variable_Register

Variable_Get

Fct_Variable_Get