sysGetVariableLong
CAPL Functions » System Variables » sysGetVariableLong Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
long sysGetVariableLong(char namespace[], char variable[]); // form 1long sysGetVariableLong(SysVarName); // form 2long sysGetVariableLong(char namespace[], char variable[], long& value); // form 3long sysGetVariableLong(SysVarName, long& value); // form 4
Description
Returns the value of a system variable of type long (32bit signed integer). Note- Direct access to values from system variables.
-
The function can also be used for specific elements of a system variable of type struct or generic array. For this, add the element to the name of the variable. If you directly give the element name to the function instead of using strings, precede the name by
sysvarMember::instead ofsysvar::. Example:sysvarMember::SomeNamespace::SomeStructVariable.SomeArrayMember[0] - The function can also be used for variables of type unsigned integer. You can simply cast the result to dword.
Parameters
- namespace: Name of the namespace.
- variable: Name of the variable.
- SysVarName: Name of the fully qualified name of the system variable, including all namespaces, separated by ”::”. The name must be preceded by “sysVar::”.
- value: Receives the current value of the variable.
Return Values
-
Value of the variable or 0 in case of error (form 1 and 2)
- 0: No error, function successful (form 3 and 4)
- 2: Variable was not found (form 3 and 4)
- 4: Variable has no suitable type for the function (form 3 and 4)