GET_ATTR_VAL ​
GET_ATTR_VAL returns an attribute value. The queried object can be an instance (model, modeling object, connector, record row, attribute profile) or a class.
Syntax ​
CC "Core" GET_ATTR_VAL objid:idValue AttrSpec
[ as-string ] [ core-value ]
[ format:strValue ] [ sep:strValue ] .
AttrSpec : attrid:idValue| attrname:strValue .
#-->RESULT ecode:intValue val:anyValue
Parameters ​
objid
(idValue) -attrid
(idValue) -attrname
(strValue) -as-string
(modifier) -core-value
(modifier) -format
(strValue) -sep
(strValue) -
Returns ​
ecode
(intValue) - Contains the error code or is 0 in case of success.val
(anyValue) -
Details ​
The argument attrid has to be set to the ID of the attribue. Alternatively the name of an attribute can be specified with attrname. The argument objid has to be set to the ID of the instance or class.
If as-string is specified, val is always of type string string, no matter what type the attribute is of. Otherwise val is of (LEO) type real for DOUBLE attributes, of type integer for INTEGER attributes, of type time for TIME attributes. Other attribute types than DOUBLE, INTEGER and TIME are returned as string anyway.
If the attribute is of type INTERREF and format is specified, val becomes the format string value for each single reference with the following replacements: %o by object name, %c by class name, %m by model name, %t by model type.
(%M, %v, %V gibt's auch noch)
The separation of multiple references can be specified with the sep string value. Default is " " (blank, which is not expedient in most cases).
If core-value is specified, the internal content of an attribute is returned. Otherwise, the result is the UI representation of the attribute value. For EXPRESSION attributes, the UI representation is the last evaluated value. core-value is needed where an attribute value shall be copied to another instance or be exported to a format which allows a later reimport.
Note: When model attributes are queried, the concerned model must be loaded.
The internal core-values for INTERREF type attributes follow the syntax:
InterRefValue : { ModelReference } | { ObjectReference } .
ModelReference : REF m:strValue mt:strValue .
ObjectReference : REF m:strValue mt:strValue c:strValue i:strValue .
The m
parameter specifies the name of a model, mt
the type of a model, c
the name of a (node) class and i
the name of an instance of the class.
The internal core-values for PROFREF type attributes follow the syntax:
REF i:strValue .
The i
parameter has the name of an instance of the allowed Attribute Profile class.
See Also ​
Examples ​
Versions and Changes ​
Available since ADOxx 1.3