AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Sintaxis WLanguage / Instrucciones estructuradas
  • Syntax 1: Browse field elements
  • Syntax 2: Browse selected field elements
  • Browsing the rows of a Table control
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The statement FOR EACH is used to perform different types of browse on the controls (List Box, Table or Looper controls):
  • Iterating over the elements in the control.
  • Browse the values of the selected elements.
  • Browse the indexes of the selected elements.
Note: The FOR EACH, FOR ALL statements are accepted. The FOR EACH statement will be used in this documentation but it can be replaced with FOR ALL.
Limitation: This instruction cannot be used on Combo Box controls.
The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface.
Ejemplo
// For each user selected in TABLE_User
FOR EACH SELECTED ROW OF TABLE_User
	// Send an email
	Proc_SendMessage(COL_Name, COL_Email)
END
New in SaaS
FOR ALL LINES TABLE_Product index WITHOUT Filter
	IF TABLE_Product.Discount[Index] > 0 THEN
		// Line processing 
	END
END
Sintaxis

Browsing the control elements (Table, List Box and Looper) Ocultar los detalles

FOR ANY LINE [<Indice> [, <Compteur>]] FROM <Champ> [WITHOUT FILTER]
  ...
END
<FOR EACH ROW>:
Marks the beginning of the statement block.
<Subscript>: Optional
Optional Integer variable. For each iteration, contains the index of the current row.
<Counter>: Optional
Optional Integer variable. This variable counts the number of iterations.
<Control>: Control name
Field to browse: List Box control, Table control or RepeatString field.
<WITHOUT FILTER>: Optional
New in SaaS
Signals that filters implemented by users via the AAF (Automatic Functionalities of your applications) will not be taken into account when browsing lines in the Table control field.
Can only be used when browsing a Table control.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.

Browsing the selected elements Ocultar los detalles

FOR EACH SELECTED ROW [<Index>, [<Counter>]] OF <Control>

    ...
END
<FOR EACH SELECTED ROW>:
Marks the beginning of the statement block.
<Subscript>: Optional
Integer variable. For each iteration, contains the index of the current selected row.
<Counter>: Optional
Optional Integer variable. This variable counts the number of iterations (number of selected rows for example).
<Control>: Control name
Field to browse: List Box control, Table control or RepeatString field.
Observaciones

Syntax 1: Browse field elements

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 index of the current row. <Index> can also be used to find out the index of the current row.
  • <Control name>[<Control name>] returns all the columns separated by TAB characters. This syntax is equivalent to <Nom du champ>[<Indice>].
  • <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.
New in SaaS
If the WITHOUT FILTER is specified when browsing a Table field, this syntax allows you to browse all the lines in a Table field, regardless of the filters specified by the user via the AAF (Automatic Application Features).
Filters implemented by programming are taken into account.
This syntax can be used, for example, to search for an element in a hidden column of the Table control.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 3.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.

Syntax 2: Browse selected field 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 index of the current selected row. <Indice> also displays the index of the currently selected line.
  • <Control name>[<Control name>] returns all the columns separated by TAB characters.
  • <Column name> returns the column value for the row currently browsed. It is also possible to use the syntax: <Colonne>[<Indice>]
Behavior change in version 12: Before version 12, the path 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 data-bound Table control, in the browse loop, the current record is the record processed by the browse.
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
FOR EACH ROW... Locks the display of the Table
If you try to use For Each Row of table... to alter the display of a table -
This will not work.
FOR EACH ROW of Table_SomeData
If col_amount < 0 Then
col_Amount..brushcolor = LightRed
END
END
This does work-
FOR Row = 1 _to_ Table_SomeData..occurrence
If Table_SomeData[nRow].col_amount < 0 Then
Table_SomeData[nRow].col_Amount..brushcolor = LightRed
END
END

Chris
01 03 2018

Última modificación: 20/06/2025

Señalar un error o enviar una sugerencia | Ayuda local