Forces the processing of every line (loaded) or selected in a grid.
For each line [ in <GridName> ]
Sequence of valid language commands.
Allows you to process all lines or selected lines in the grid. It can be used, for example, to mark all the lines that fulfill a specific condition.
For Each Line has the following properties and restrictions:
- It only processes the records loaded from the grid.
- It processes all lines whether they have been modified or not.
- The lines are processed in the same order as they were selected.
- In the Enter event, if the For each line command is used, each line is processed. However, it is the programmer's responsibility to update the grid values.
- In non-visual generators, you can only select the line on which the cursor is (simple selection) positioned. In Visual FoxPro it is not possible to select many lines from a grid (it's a Visual FoxPro restriction and not of the generator).
- For Each Line command is supported in nested Grid (since X Evolution 3 Upgrade 7). The external Grid must be a Free Style, and the parent row must be instanciated. That means, the button that trigger the event must be inside the parent's grid or the event must be programed in this way:
For Each Line in ExternalGrid
For Each Line in InternalGrid
Event Enter // We want to put an * to all processed lines
For each line
If &Op = '*' // If it already has an * we put '\'
&Op = '\'
If &Op = '/' // The line is processed
&Op = '*'
Objects: Web Panels
.NET, Ruby (up to GeneXus X Evolution 3), Java, RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol
For Each command