FILE Item Attributes
Contents
FILE Item Attributes
The following file item attributes can be queried in the format $#fileItem[!ATTRIBUTENAME]
.
General file item attributes
Attribute-Id | Value(s) and Description |
!PATH | full path of file attached to the file item |
!DRIVE | drive letter (without trailing ':') of file attached to the file item |
!DIRECTORY | directory (without trailing '\') of file attached to the file item |
!NAME | name of file attached to the file item |
!EXTENSION | filetypeextension|type (without leading '.') of file attached to the file item |
!CREATED | creationdatetime(yyyy.mm.dd hh.mm.ss) creation date and time of file attached to the file item |
!MODIFIED | modificationdatetime(yyyy.mm.dd hh.mm.ss) last modification date and time of file attached to the file item |
!ATTRIBUTES | HIDDEN|NORMALtype attributes of file attached to the file item |
!ACCESS | APPENDaccess attributes of file attached to the file item |
!SIZE | filesize,size of file attached to the file item in bytes |
!TYPE | TEXT|SECTION|XMLtype of file item (set in NEW command) |
!SHELL | ownershellidid of shell creating the file item (8 hex digits) |
!USERS | numusersnumber of linked items sharing the file item |
!LASTACCESS | lastaccesseddatetime(yyyy.mm.dd hh.mm.ss) date and time of the last access to the file attached to the file item |
!CHANGED | |
1|0A value of 1 indicates that the file has been changed in memory and has not been saved yet. A value of 0 indicates that the file in memory is identical to that on disk. | |
0|1 | If a value of 1 or 0 is specified as the second parameter, the changed attribute can be explicitly set or reset.$#file[!changed] := 1 // set the attribute$#file[!changed] := 0 // reset the attributeWarning: this functionality changed in version 3.9.0. Previously, setting the attribute using '1' would *reset* the attribute, and using the value '0' was unsupported.
|
|
|}
Binary file item attributes
Attribute-Id | Value(s) and Description |
!BININFO | number of sectionsAfter a LIST commandindex of last loaded/saved sectionAfter a LOAD command-1If the file is not a binary file, or the last command failed. |
GDX file item attributes
The GDX file item supports the following attributes in addition to the general file item attributes.
- !DATA
- The
!DATA
attribute returns data from the GDX file.
$#gdx[!DATA] // returns all the data
$#gdx[!DATA,index,count] // returns one or more columns
index
determines the first column, andcount
the number of columns to return.
- !DATATYPE
- The !DATATYPE attribute returns the data type of this GDX file (See Creating a GDX file for details).
- !NCOL
- The
!NCOL
attribute returns the number of columns.
- !NROW
- The
!NROW
attribute returns the number of rows.
- !NWRITTEN
- The
!NWRITTEN
attribute returns the number of columns which have been written (rather than defined).
XML file item attributes
General attributes of XML file items
Attribute-Id | Value(s) and Description |
---|---|
!XROOT | root_element_nametag name of the root element |
!XPARENT | parent_element_nametag name of the parent element |
!XPARENTPATH | root_element_name\..\parent_element_name full path of the parent element |
!XELEMENTS | elementcountnumber of elements on selected element level |
!XNODETYPE | COMMENT|PROC|DOCTYPE type of the selected node |
Attributes of the selected element of a XML file item
Attribute-Id | Value(s) and Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
!XALL | tag empy cdata childs size nattr attr0 ... attrNa list of all element parts:
XML file item document/element type definition attributes
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!XDTCHILDREN | tag | - | number of children defined for element tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!XDTCHILD | tag | cindex or ctag | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ctag | tag of child element | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
min | number of minimum occurrences | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
max | number of maximum occurrences or -1 if not defined |
|-
|!XDTATTRIBUTES
|tag
|-
|number of attributes defined for element tag
|-
|!XTDATTRIBUTE
|tag
|aindex or aname
|definition of attribute aindex or aname of element tag. The result is:aname req vis val type paramswith:{|
|-
|aname
|name of attribute
|-
|req
|required flag (0=no, 1=yes)
|-
|vis
|visibility flag (0=hidden, 1=value, 2=name and value)
|-
|val
|default value of * if not set
|-
|type
|attribute value type (INTEGER, NUMBER, STRING, VALUELIST)
|-
|params
|parameters, depends on type{|
|-
|INTEGER
|minval|* maxval|*
|-
|NUMBER
|minval|* maxval|*
|-
|STRING
|unique{0|1} respect{0|1}
|-
|VALUELIST
|value1 value2 ...
|}
|}
|}
!XDTISA
Sub-Id1:
tag
Value(s) and Description:
returns 1 if the selected element of the file item is of type tag or is derived from tag and 0 otherwise