Programmer Guide/Shell Items/File/FILE Item Attributes: Difference between revisions
From STX Wiki
< Programmer Guide | Shell Items | File
Jump to navigationJump to search
Line 216: | Line 216: | ||
!Value(s) and Description | !Value(s) and Description | ||
|- | |- | ||
|!XDTNAME | |<code>!XDTNAME</code> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|name of document type definition | |name of document type definition | ||
|- | |- | ||
|!XDTROOT | |<code>!XDTROOT</code> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|tag of root element | |tag of root element | ||
|- | |- | ||
|!XDTELEMENTS | |<code>!XDTELEMENTS</code> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|number of defined element types | |number of defined element types | ||
|- | |- | ||
|!XDTELEMENT | |<code>!XDTELEMENT</code> | ||
|index or tag | |index or tag | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
Line 240: | Line 240: | ||
|- | |- | ||
|parent | |parent | ||
|parent element tag or * | |parent element tag or <code>*</code> | ||
|- | |- | ||
|base | |base | ||
|base element tag or * | |base element tag or <code>*</code> | ||
|- | |- | ||
|nobase | |nobase | ||
|nobase element tag or * | |nobase element tag or <code>*</code> | ||
|- | |- | ||
|data | |data | ||
|data type name or * | |data type name or <code>*</code> | ||
|} | |} | ||
|- | |- | ||
|!XDTCHILDREN | |<code>!XDTCHILDREN</code> | ||
|tag | |tag | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|number of children defined for element tag | |number of children defined for element tag | ||
|- | |- | ||
|!XDTCHILD | |<code>!XDTCHILD</code> | ||
|tag | |tag | ||
|cindex or ctag | |cindex or ctag | ||
Line 271: | Line 271: | ||
|} | |} | ||
|- | |- | ||
|!XDTATTRIBUTES | |<code>!XDTATTRIBUTES</code> | ||
|tag | |tag | ||
|<nowiki>-</nowiki> | |<nowiki>-</nowiki> | ||
|number of attributes defined for element tag | |number of attributes defined for element tag | ||
|- | |- | ||
|!XTDATTRIBUTE | |<code>!XTDATTRIBUTE</code> | ||
|tag | |tag | ||
|aindex or aname | |aindex or aname | ||
Line 293: | Line 293: | ||
|- | |- | ||
|type | |type | ||
|attribute value type (INTEGER, NUMBER, STRING, VALUELIST) | |attribute value type (<code>INTEGER</code>, <code>NUMBER</code>, <code>STRING</code>, <code>VALUELIST</code>) | ||
|- | |- | ||
|params | |params | ||
|parameters, depends on type{| | |parameters, depends on type{| | ||
|- | |- | ||
|INTEGER | |<code>INTEGER</code> | ||
|minval<nowiki>|</nowiki>* maxval|* | |minval<nowiki>|</nowiki>* maxval|* | ||
|- | |- | ||
|NUMBER | |<code>NUMBER</code> | ||
|minval<nowiki>|</nowiki>* maxval|* | |minval<nowiki>|</nowiki>* maxval|* | ||
|- | |- | ||
|STRING | |<code>STRING</code> | ||
|unique{0<nowiki>|</nowiki>1} respect{0|1} | |unique{0<nowiki>|</nowiki>1} respect{0|1} | ||
|- | |- | ||
|VALUELIST | |<code>VALUELIST</code> | ||
|value1 value2 | |value1 value2 … | ||
|} | |} | ||
|- | |- | ||
| !XDTISA | | <code>!XDTISA</code> | ||
| <var>tag</var> | | <var>tag</var> | ||
| none | | none | ||
| returns <code>1</code> if the selected element of the file item is of type <var>tag</var> or is derived from <var>tag</var> and <code>0</code> otherwise | | returns <code>1</code> if the selected element of the file item is of type <var>tag</var> or is derived from <var>tag</var> and <code>0</code> otherwise | ||
|} | |} |
Revision as of 13:46, 6 November 2012
The following file item attributes can be queried in the format $#fileItem[Attribute]
.
Contents
Common file item attributes
Attribute | Value(s) and Description | |
---|---|---|
!PATH
|
full path of the file attached to the respective file item | |
!DRIVE
|
the drive letter of the file attached to the respective file item (without a colon) | |
!DIRECTORY
|
the directory of the file attached to the respective file item (without a trailing backslash) | |
!NAME
|
the name of file attached to the respective file item | |
!EXTENSION
|
extension part of the filename of the file attached to the respective file item (without a leading ". ")
| |
!CREATED
|
yyyy.mm.dd hh.mm.ss
|
creation date and time of file attached to the file item |
!MODIFIED
|
yyyy.mm.dd hh.mm.ss
|
time of last modification of file attached to the file item |
!ATTRIBUTES
|
DIRECTORY|SYSTEM|HIDDEN|NORMAL
|
type attributes of file attached to the file item |
!ACCESS
|
READ|WRITE|APPEND
|
access attributes of file attached to the file item |
!SIZE
|
filesize
|
size of file attached to the file item in bytes |
!TYPE
|
FILE|LIST|TEXT|SECTION|XML
|
type of file item (set in NEW command) |
!SHELL
|
owner
|
shellidid of shell creating the file item (8 hex digits) |
!USERS
|
numusers
|
number of linked items sharing the file item |
!LASTACCESS
|
yyyy.mm.dd hh.mm.ss
|
date and time of the last access to the file attached to the file item |
!CHANGED
|
1|0
|
A 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. |
assigning 1 or 0
|
You may programmatically set, or reset, the value of the !CHANGED attribute by assigning 1 , or 0 , to this attribute:
$#file[!changed] := 1 // set the attribute $#file[!changed] := 0 // reset the attribute Warning: 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 items
Attribute | Value(s) | Description |
---|---|---|
!BININFO
|
number of sections | After a LIST command, !BININFO will return the index of the last section loaded/saved.
|
After a LOAD command -1 , if the file is not a binary file, or the last command failed.
|
GDX file items
The GDX file item supports the following attributes in addition to the general file item attributes.
Attribute | Value(s) and Description | |
---|---|---|
!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 Here the | |
!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 items
General attributes of XML file items
Attribute | Value(s) | 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
|
ELEMENT|COMMENT|PROC|DOCTYPE
|
type of the selected node |
Attributes of the selected element of an XML file item
Attribute | Argument | Value(s) and Description |
---|---|---|
!XALL
|
||
a list of all element parts | ||
tag | element tag name | |
empty | 1 if element data is empty, 0 otherwise | |
cdata | 1 if element data is a CData-section, 0 otherwise | |
childs | number of child elements | |
size | size of data section (characters) | |
nattr | number of attributes | |
attr0,… | name of attribute 0, … (0 to nattr-1) | |
!XTAG
|
- | element_tag |
!XATTRIBUTES
|
- | number_of_attributes |
!XATTRIBUTE
|
index | attribute_name name of attribute number index |
!XATTRIBUTE
|
name | attribute_value value of attribute named name |
!XEMPTY
|
- | returns 1 if element is empty (no data) and 0 otherwise |
!XCDATA
|
- | returns 1 if element contains a CData section and 0 otherwise |
!XCHILDS or !XCHILDREN
|
- | returns number of child elements of the selected element |
!XSIZE
|
- | size of data section in characters |
!XDATA
|
- | content of data section |
Document/element type definition attributes of an XML file item
Attribute-Id | Sub-Id 1 | Sub-Id 2 | Value(s) and Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
!XDTNAME
|
- | - | name of document type definition | ||||||||||||||||||||
!XDTROOT
|
- | - | tag of root element | ||||||||||||||||||||
!XDTELEMENTS
|
- | - | number of defined element types | ||||||||||||||||||||
!XDTELEMENT
|
index or tag | - | definition of element type with specified index or tag; the result is
| ||||||||||||||||||||
!XDTCHILDREN
|
tag | - | number of children defined for element tag | ||||||||||||||||||||
!XDTCHILD
|
tag | cindex or ctag | definition of child cindex or ctag of the element tag. The result is:ctag min maxwith:
| ||||||||||||||||||||
!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:
| ||||||||||||||||||||
!XDTISA
|
tag | none | returns 1 if the selected element of the file item is of type tag or is derived from tag and 0 otherwise
|