Programmer Guide/Command Reference/IREF: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
This basic form of the <code>IREF</code> command retrieves the iref of the currently selected element: | This basic form of the <code>IREF</code> command retrieves the iref of the currently selected element: | ||
<var>var</var> := IREF <var>xmlfile</var> /Format [ /Attribute=<var>irefAttr</var> ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] | <var>var</var> := IREF <var>xmlfile</var> /Format [ /Attribute=<var>irefAttr</var> ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] | ||
Note that the <code>/Format</code> option is mandatory. | |||
When you supply an STx file position, <var>position</var>, the <code>IREF</code> command retrieves the iref of the element whose position you supplied: | When you supply an STx file position, <var>position</var>, the <code>IREF</code> command retrieves the iref of the element whose position you supplied: | ||
<var>var</var> := IREF <var>xmlfile</var> /Format <var>position</var> [ /Attribute=<var>irefAttr</var> ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] | <var>var</var> := IREF <var>xmlfile</var> /Format <var>position</var> [ /Attribute=<var>irefAttr</var> ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] | ||
In this case, the option <code>/Delete</code> will cause the STx position to be deleted. | In this case, the option <code>/Delete</code> will cause the STx position to be deleted. Note that here, too, the <code>/Format</code> option is mandatory. | ||
<var>var</var> := IREF <var>xmlfile</var> <var>table</var> <var>posfld</var> <var>reffld</var> [ /Delete /Tagged ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] | <var>var</var> := IREF <var>xmlfile</var> <var>table</var> <var>posfld</var> <var>reffld</var> [ /Delete /Tagged ] [ /Baseposition=<var>basePos</var> ] [ [[Programmer_Guide/Command_Reference_Options/Silent|/Ilent]] ] |
Revision as of 12:20, 5 April 2011
The IREF
command returns the internal reference (IREF
) of the currently selected element of the supplied XML file item, or, if you provide additional element data, the internal reference for the respective element of the supplied XML file item. If this information is not available, or not applicable, the IREF
command will return the empty string.
This basic form of the IREF
command retrieves the iref of the currently selected element:
var := IREF xmlfile /Format [ /Attribute=irefAttr ] [ /Baseposition=basePos ] [ /Ilent ]
Note that the /Format
option is mandatory.
When you supply an STx file position, position, the IREF
command retrieves the iref of the element whose position you supplied:
var := IREF xmlfile /Format position [ /Attribute=irefAttr ] [ /Baseposition=basePos ] [ /Ilent ]
In this case, the option /Delete
will cause the STx position to be deleted. Note that here, too, the /Format
option is mandatory.
var := IREF xmlfile table posfld reffld [ /Delete /Tagged ] [ /Baseposition=basePos ] [ /Ilent ]
var := IREF xmlfile /Select [ iref | position ] [ /Nocase ] [ /Attribute=irefAttr ] [ /Baseposition=basePos ] [ /Ilent ]
Returns the internal reference (IREF
) to the selected element or an empty string.
- xmlfile
- The id of an XML file item.
- /Format
- This option is mandatory.
- /I
- If set, errors are suppressed, and warnings are generated instead.
var := IREF xmlfile pos /Format /Delete [ /I ]
Returns the internal reference to the element at the position pos or an empty string. If /Delete is specified, the position is also deleted.
- pos
- The position of an element in the XML file xmlfile.
- /Delete
- This option is mandatory.
See the commands above for a description of the other parameters and options.
IREF xmlfile table posFld refFld /Format /Delete /All|Tagged [ /I ]
Stores the internal references to the element found at the positions in the field posFld in the field refFld. If /Delete is specified, or posFld is the same as refFld, then the positions are also deleted.
- table
- The id of an extended table.
- posFld
- The name of the field where the element positions are stored.
- refFld
- The name of the field where the IREFs should be stored. If this is the same as posFld, then the positions are deleted before being overwritten.
- /All|Tagged
- If /All is specified, all table entries are used (this is the default). If /Tagged is specified, then only the tagged entries are used.
See the commands above for a description of the other parameters and options.
IREF xmlfile iref|pos /Select [ /I ]
Select the element at the specified position (pos) or internal reference (iref).
- iref
- The internal reference of an existing element.
- pos
- The position of an existing element.
- /Select
- This option is mandatory.
Please not that you must surround the ref argument with single quotes, otherwise it will be interpreted as an option.
<code>IREF '$#f' '$#aset' /Select</code>