/
gmscVarValuesClass
gmscVarValuesClass
Mark Juras
Owned by Mark Juras
The VarValues Service Class
The service class VarValues contains those methods used by the engine to allocate, store, and retrieve variable values. The members of the tVariable structure used by this class are as follows:Member | Description of content |
migComment | Contains the sequence number of the variable, starting at one, within the list of parameters and then local variables declared within the subprogram. |
specInfo | If the variable is a scalar then this is set to zero else it is set to the the number of elements in the array. |
The method VarValues_Construct
Prototypevoid* VarValues_Construct(int subRoot)
Parameter | Description |
subRoot | specifies the root offset of the subprogram being called. |
Each parameter and local variable defined for the subprogram is assigned a sequence number starting at one by the method VarValues_SetLocalVariables. The corresponding entry in the values vector controls the values for that component during the current call to the subprogram. The zero member of the values vector contains the control information for the values vector itself. The method returns an opaque handle to the variable values vector. It is this handle that is referred to as This in methods using this vector.
The method VarValues_Destroy
Prototypevoid VarValues_Destroy(void* This)
Parameter | Description |
This | specifies the handle of the variable values vector. After this call the content of this handle is no longer valid. |
The method VarValues_GetHandle
Prototypevoid* VarValues_GetHandle(void* This,int seq)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose member is being accessed. |
The method returns a pointer to the start of the value vector for this instance of the structure.
The method VarValues_GetType
Prototypeint VarValues_GetType(void* This,int seq)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose type is being gotten. |
The engines using this class support variant types that are not imposed on a variable until runtime. The consequence of this is that variables do not necessarily have the same type in different executions of their subprogram. The type is recorded in the variable value vector and not in the information vector of the variable itself.
The method VarValues_GetValue
Prototypeint VarValues_GetValue(void* This,int seq)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose value is being gotten. |
The method VarValues_PopHandle
Prototypevoid* VarValues_PopHandle(void* This)
Parameter | Description |
This | specifies the handle of the variable values vector. |
The method pops a value or vector from the runtime data queue and returns a pointer obtained from the information popped to an actual value or value vector that is being passed to a method.
The method VarValues_PopObject
Prototypevoid* VarValues_PopObject(void* This)
Parameter | Description |
This | specifies the handle of the variable values vector. |
First, the sequence number of a variable is popped fron the stack. If that variable has an object type with values associated with it then the handle to those values is returned. If no values are associated with the object type, they are initialized in scratch information storage and the handle is returned. If not an object type, then a simple pointer to the values is returned.
The method VarValues_PushObject
Prototypevoid VarValues_PushObject(int symRoot,int symType,void* handle)
Parameter | Description |
symRoot | specifies the root of the object. |
symType | specifies the object type of the object. |
handle | specifies the handle for the information associated with the object. |
The method VarValues_PushValue
Prototypevoid VarValues_PushValue(void* This,int seq,int subscript)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose value is being pushed. |
subscript | specifies the subscript relative to 0 of the value if the variable is an array. If the variable is not an array this parameter is ignored. |
The method VarValues_SetExternalCall
Prototypevoid VarValues_SetExternalCall(void* This,int subRoot, char* prams)
Parameter | Description |
This | specifies the handle of the variable values vector. |
subRoot | specifies the root offset of the subprogram being called. |
prams | contains the values to be assigned to the parameters of the subprogram. For integer parameters it should contain a valid integer representation and for booolean parameters it should contain ".T." or ".F.". |
The method VarValues_SetInternalCall
Prototypevoid VarValues_SetInternalCall(void* This, int subRoot)
Parameter | Description |
This | specifies the handle of the variable values vector. |
subRoot | specifies the root offset of the subprogram being called. |
The actual initial parameter values for the subprogram are popped from the runtime data queue.
The method VarValues_SetLocalVariables
Prototypevoid VarValues_SetLocalVariables(int subRoot)
Parameter | Description |
subRoot | specifies the rool offset of the complied gmSL method. |
The method VarValues_SetValue
Prototypevoid VarValues_SetValue(void* This,int seq,int value)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose value is being set being set. |
value | specifies the new value. |
The method VarValues_StoreValue
Prototypevoid VarValues_StoreValue(void* This,int seq,int subscript)
Parameter | Description |
This | specifies the handle of the variable values vector. |
seq | specifies the sequence number of the variable whose value is being stored. |
subscript | specifies the subscript relative to 0 of the value if the variable is an array. If the variable is not an array this parameter is ignored. |
Table of Contents
, multiple selections available,
Related content
gmSCOpcodeClass
gmSCOpcodeClass
More like this
gmslStoreClass
gmslStoreClass
More like this
gmscTraceLogClass
gmscTraceLogClass
More like this
gmSCProcessServicesClass
gmSCProcessServicesClass
More like this
gmplLoadEnviromentStatement
gmplLoadEnviromentStatement
More like this
gmscTypeInferenceClass
gmscTypeInferenceClass
More like this