getscalarvalue
getscalarvalue |
Purpose
Query the value of a scalar variable
Synopsis
function xreflect~getscalarvalue(entityname:string):xreflect~basicvalue
Argument
entityname
|
The name of the public entity to query
|
Return value
A
basicvalue containing the value stored in the entity.
Example
The following:
public declarations myvar: string, end-declarations myvar := 'hello' writeln('myvar=',getscalarvalue('myvar'))
produces this output:
myvar=hello
Further information
1. If the specified entity name cannot be found, the model will terminate with a runtime error.
2. If the specified entity is not of a supported type, the model will terminate with a runtime error.
3. If the specified entity is not a scalar variable or constant, the model will terminate with a runtime error.
Related topics