|
|
|
|
|
- Syntax 1: Iterating over the elements in the control
- Syntax 2: Browsing the selected control elements
- Browsing the rows of a Table control
FOR EACH/FOR ALL statement (loop through controls) In french: POUR TOUT / POUR TOUS
The statement FOR EACH is used to perform different types of browse on the controls (List Box, Table or Looper controls): - Browsing the control elements.
- Browsing the values of the selected elements.
- Browsing the subscripts of the selected elements.
Remark: The FOR ALL, FOR EACH statements are accepted. The FOR EACH statement will be used in this documentation but it can be replaced with FOR ALL. Limitation: This statement cannot be used on the Combo Box controls. The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface. // For each user selected in TABLE_User FOR EACH SELECTED ROW OF TABLE_User // Send an email Proc_SendMessage(COL_Name, COL_Email) END
Syntax
Browsing the control elements (Table, List Box and Looper) Hide the details
FOR EACH ROW [<Index> [, <Counter>]] OF <Control> ... END
<FOR EACH ROW>: Marks the beginning of the statement block. <Subscript>: Optional Integer variable. For each iteration, contains the index of the current row. <Counter>: Optional Integer variable. This variable counts the number of iterations. <Control>: Control to browse: List Box, Table or Looper control.
Browsing the selected elements Hide the details
FOR EACH SELECTED ROW [<Index>, [<Counter>]] OF <Control>
... END
<FOR EACH SELECTED ROW>: Marks the beginning of the statement block. <Subscript>: Integer variable. For each iteration, contains the index of the current selected row. <Counter>: Optional Integer variable. This variable counts the number of iterations (number of selected rows for example). <Control>: Control to browse: List Box, Table or Looper control. Remarks Syntax 1: Iterating over the elements in the control This syntax is used to browse all the rows, visible or not, of a List Box, Table or Looper control. For each row browsed: - <Control name> returns the subscript of the current row. <Index> can also be used to find out the subscript of the current row.
- <Control name>[<Control name>] returns all the columns separated by TAB characters. This syntax is equivalent to <Control name>[<Subscript>].
- <Column name> returns the column value for the row currently browsed.
The browse has no effect on the current selection. The behavior is undefined if the number of control elements is modified during the browse. Syntax 2: Browsing the selected control elements This syntax is used to browse all the selected rows, visible or not, of a List Box, Table or Looper control. For each row browsed: - <Control name> returns the subscript of the current selected row. <Index> can also be used to find out the subscript of the current selected row.
- <Control name>[<Control name>] returns all the columns separated by TAB characters.
- <Column name> returns the column value for the row currently browsed. You can also use the following syntax: <Column>[<Subscript>]
Change of behavior in version 12: Before version 12, the browse operation had no influence on the current selection. From now on, the current row in the table is always moved during the browse. The behavior is undefined if the number of control elements is modified during the browse. Browsing the rows of a Table control When browsing the rows of a Table control: - the display of this Table control is locked. MultitaskRedraw is ignored.
- the selected rows and/or the current row must not be modified (TableSelectMinus, TableSelectPlus, ...).
- for a browsing Table control, in the browse loop, the current record is the record processed by the browse.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|