SetData/SetVal
Sets a value for the ANYTYPE structure
void SetData(
int val
);
void SetData(
double val
);
void SetData(
TCHAR *val
);
void SetVal(
int val
);
void SetVal(
double val
);
void SetVal(
TCHAR *val
);
Parameters
val
|
alue to be set to the ANYTYPE structure
|
Return Value
None
Description
Please use SetData when newly programming it. To maintain interchangeability, SetVal has been left.
Sets the specified value for the ANYTYPE structure.
The value of TYPE is automatically set based on the type of the value to be set.
* For string (TCHAR *), the starting address of the string is set. Therefore, note that if you create string data as a local variable and set it using this method, there is no string returned from the function and the method does not work correctly.
Example
int Sample::GetUnitData(ProcUnit *ptrProcUnit, int dataNo, ANYTYPE *data)
{
int intData = 100;
double doubleData = 1000.5;
TCHAR strData[256];
// Set the data of type int
data->SetData(intData);
// Set the data of type double
data->SetData(doubleData);
// Set the data of string
data->SetData(strData);
}