PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Syntax 1: Browsing the control elements
  • Syntax 2: Browsing the selected control elements
  • Browsing the rows of a Table control
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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.
Note: The FOR ALL, FOR EACH statements are accepted. In this documentation, we will be using the FOR EACH statement but it can be replaced by FOR ALL.
Limitation: This statement cannot be used on the Combo Box controls.
Versions 15 and later
The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface.
New in version 15
The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface.
The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Example
// 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 [<Subscript> [, <Counter>]] OF <Control>

    ...
END
<FOR EACH ROW>:
Marks the beginning of statement block.
<Subscript>:
Optional Integer variable. For each iteration, contains the subscript 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.
Universal Windows 10 App The Table controls are not available.
Universal Windows 10 App The Table controls are not available.

Browsing the selected elements Hide the details

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

    ...
END
<FOR EACH SELECTED ROW>:
Marks the beginning of statement block.
<Subscript>:
Integer variable. For each iteration, contains the subscript 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.
Universal Windows 10 App The Table controls are not available.
Universal Windows 10 App The Table controls are not available.
Remarks

Syntax 1: Browsing the control 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 subscript of current row. <Subscript> can also be used to find out the subscript of 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. <Subscript> can also be used to find out the subscript of 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.
Universal Windows 10 App Reminder: The Table controls are not available.
Universal Windows 10 App Reminder: The Table controls are not available.
Minimum version required
  • Version 10
This page is also available for…
Comments
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 Mar. 2018
Exemplo converter
Nessa aula de hoje, vou mostrar como posso fazer um programa de conversão.
Nesse exemplo quero trocar o codigo da empresa das duplicatas a pagar.
Vou trocar da empresa 1 para empresa 2.

//===============
In this class today, I'll show you how I can do a conversion program.
In this example I want to change the company code of the duplicates to be paid.
I will change from company 1 to company 2.
//===============
Dans cette classe, aujourd'hui, je vais vous montrer comment je peux faire un programme de conversion.
Dans cet exemple, je souhaite modifier le code des comptes créditeurs de la société.
Je vais changer la société 1 à la société 2.

//===============

http://windevdesenvolvimento.blogspot.com.br/2017/03/aula-1086-windev-tabela-052-trocar.html

https://www.youtube.com/watch?v=OvbcWdgbG_g


De matos
10 Mar. 2017
Tabela percorrer

FOR EACH ROW OF TABLE_Cliente
Trace(TABLE_Cliente.COL_Nome)
END

//frances
POUR CHAQUE LIGNE DE TABLE_Cliente
Trace(TABLE_Cliente.COL_Nome)
FIN

//blog com video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-tabela-012-for-each-row-of.html
De matos AMARILDO
02 Mar. 2016