aci.Obj_QueryAttr

SUMMARY

Query data object attributes / properties

SYNTAX

aci.Obj_QueryAttr((<object number>|<point id>), <attr>)

ARGUMENTS

object number (type:number)
A data object number
point id (type:string)
The name of a data object
attr (type:integer)
An identifier for the required attribute. Use the global table DOATTR. The names of the elements of DOATTR are the same as the attribut names in the display editor.

RETURN VALUES

1 (type:any)
Returns the value of the requested attribute if it exists for the given data object.

ERROR HANDLING

The function will fail and terminate script execution if strict error checking is enabled (see aci.SetStrictMode()) and one of the following conditions is met:

EXAMPLES

Get the measuring point value of TANKLEVEL

aci.Obj_QueryAttr("TANKLEVEL", DOATTR.Value)
		

You can store object numbers for later use to speed up queries:

objnum = aci.Obj_QueryAttr("TANKLEVEL", DOATTR.ObjNum) --get object number of object TANKLEVEL
print(aci.Obj_QueryAttr(objnum, DOATTR.Descr)) --print the description of TANKLEVEL to the command line
		


Syntax Notation
[aaa]
aaa is optional (zero or one occurences)
(aaa|bbb)
aaa exclusive or bbb
(aaa)*
aaa may occur indefinitely often or may be omitted
(aaa)+
aaa may occur indefinitely often but at least once
(aaa)m..n
aaa may occur from m to n times