Purpose |
With
ReadRow
you can read a row of a GuiXT table variable into a structured variable. |
Example |
ReadRow
V[customerinfo]
table=V[customers]
index=2
The second row of the table
variable
V[customers]
is read. All columns with a matching name are copied into
the corresponding components of the structured variable
V[customerinfo].
|
Format |
ReadRow
V[strname]
table=V[tabname]
index=k
ReadRow V[strname]
table=V[tabname]
key=keystring
ReadRow V[strname]
table=V[tabname]
match=V[strmatch] |
Explanation
index= |
- If the given index is
less than 1 or greater than V[tabname.rowcount] the structured
variable remains unchanged.
With
if Q[ok] you can query whether
the index was between 1 and V[tabname.rowcount]
- The structured
variable and the table may have a different structure. Components
without a matching counterpart in the table remain unchanged.
|
Explanation
key= |
- Searches the first
table row where the first column equals the given key value. If no
such row is found the structured variable remains unchanged.
With if Q[ok]
you can query whether a suitable row has been found.
- The structured
variable and the table may have a different structure. Components
without a matching counterpart in the table unchanged.
- Further options are
explained below
Example:
ReadRow
V[customerinfo]
table=V[customers]
key="&V[customernumber]"
|
Explanation
match= |
- You specify a second
structured variable. The command searches the first table row where
all columns with a matching name in this structured variable have
the same value. If no such row is found the structured variable
remains unchanged.
With
if Q[ok]
you can query whether a suitable row has been found.
- The structured
variables (both the one specified with
match= and the target variable)
and the table may have different structures. Components without a
matching counterpart in the table remain unchanged.
- Further options are
explained below
Example:
ReadRow
V[customerinfo]
table=V[customers]
match=V[customersearch]
|
Options for
key= and
match= |
-ignoreCase |
All comparisons for
key=
and
match= are performed
case-insensitive |
fromIndex= |
The search starts at the given row index
|
toIndex= |
The search ends at the given row index
|
returnindex= |
You specify a variable name "varname". The row index of the
matching row is set into V[varname]. If no row has been found the
variable obtains the value -1.
Remark: In conjuncion with
fromIndex=
this option allows you to determine successively
all matching rows in the table. |
|
Options for
match= |
-regex |
The comparisons with
match= interpret the values
specified in the search structure as regular expressions. The
system searches for a table row that matches the respective
regular expression in all components with the same name.
Examples can be found in
Table row selection based on a regular expression |
|
Components |
GuiXT +
InputAssistant |