Programmer Guide/Command Reference/IREF: Difference between revisions
(→Others) |
|||
Line 16: | Line 16: | ||
<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]] ] | ||
Here, <var>table</var> is your extended table. Both <var>posfld</var> and <var>reffld</var> must be the names of fields (i.e., columns) in your table <var>table</var>, <var>posfld</var> containing your file positions. The <code>IREF</code> command will store the ''iref'' for each position in the corresponding <var>reffld</var> entry. | Here, <var>table</var> is your extended table. Both <var>posfld</var> and <var>reffld</var> must be the names of fields (i.e., columns) in your table <var>table</var>, <var>posfld</var> containing your file positions. The <code>IREF</code> command will store the ''iref'' for each position in the corresponding <var>reffld</var> entry. Note that you maye use the same field for <var>posfld</var> and <var>reffld</var>, but that this will cause the file positions ''to be deleted'', making it a shortcut for the <code>/Delete</code> flag. | ||
;<code>/Delete</code>: If this option is supplied, or if <var>posFld</var> is the same as </var>refFld</var>, then the file positions are deleted. | |||
;<code>/All|Tagged</code>: If the <code>/All</code> option is used, ''all'' table entries are used, be they tagged or untagged (this is the default). If, on the other hand, the <code>/Tagged</code> option is supplied, then only the tagged entries are used. | |||
----- | ----- | ||
;<var>/All|Tagged</var> | ;<var>/All|Tagged</var> | ||
<code>IREF <var>xmlfile</var> <var>iref</var>|<var>pos</var> /Select [ /I ]</code> | <code>IREF <var>xmlfile</var> <var>iref</var>|<var>pos</var> /Select [ /I ]</code> |
Revision as of 12:00, 8 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.
Iref of the currently selected element
The 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.
Iref of a STx file position
- 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.
Bulk processing
If you need to retrieve the internal references for a larger number of file positions, you may supply the respective positions in an STx extended table item. In this case, the iref for each position will be stored in a different field of the same table:
var := IREF xmlfile table posfld reffld [ /Delete /Tagged ] [ /Baseposition=basePos ] [ /Ilent ]
Here, table is your extended table. Both posfld and reffld must be the names of fields (i.e., columns) in your table table, posfld containing your file positions. The IREF
command will store the iref for each position in the corresponding reffld entry. Note that you maye use the same field for posfld and reffld, but that this will cause the file positions to be deleted, making it a shortcut for the /Delete
flag.
/Delete
- If this option is supplied, or if posFld is the same as refFld, then the file positions are deleted.
/All|Tagged
- If the
/All
option is used, all table entries are used, be they tagged or untagged (this is the default). If, on the other hand, the/Tagged
option is supplied, then only the tagged entries are used.
- /All|Tagged
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>