Documentation
IPS_CreateVariable
int IPS_CreateVariable (int $VariableType)
Parameters
| VariableType |
|
Returns
ID of the newly created variable
Description
This function creates a new IPS variable of the type VariableType.
It returns an ID that can be used to uniquely identify the new variable.
Example
// Create a float variable with the name "Room temperature living room"
$VarID_RoomTemperature = IPS_CreateVariable(VARIABLETYPE_FLOAT);
IPS_SetName($VarID_RoomTemperature, "Room temperature living room"); // Name the variable
IPS_SetParent($VarID_RoomTemperature, 12345); // Move the variable below the object with the ID "12345"