Documentation
IPS_GetVariableID
int IPS_GetVariableID (string $VariableName)
Parameters
VariableName | Name of the variable |
Returns
ID of the found variable, otherwise FALSE and a Warning
Description
This function can no longer be used since IP-Symcon 2.5. Old IP-Symcon 1.0 features were removed in this release.
This function tries to determine the ID of the variable with the name VariableName. It returns the ID of the first occurrence of the variable whose name matches VariableName. If such a variable is found, its ID is returned, otherwise FALSE.
The funtion IPS_GetVariableIDByName provides a safer method to determine the ID.
Caution: Names in IP-Symcon can be chosen freely, so they are not unique. For this reason, the function can return a false ID.
Example
//Suppress error message with @
$VarID = @IPS_GetVariableID("Rainfall");
if ($VarID === false)
echo "Variable not found!";
else
echo "The Variable ID is: ". $VarID;