ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / Structured statements
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The FOR EACH statement is used to browse the available values in the combinations.
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.
Example
// Code de déclaration
// Déclarer une combinaison
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
END
// Syntax 1: Browse the combination options
FOR EACH eOption OF CombinationType
Trace(eOption..Name)
END
// Assign the variable
FileAction = ReadFile + WriteFile
 
// Syntax 2: Browse the active options
FOR EACH eOption OF FileAction
Trace(eOption..Name)
END
Syntax

Simplified syntax Hide the details

FOR EACH <MyOption> OF <Combination>
    ...
END
<FOR EACH>:
Marks the beginning of the statement block.
<MyOption>:
Option Description variable corresponding to the combination option. There is no need to declare this variable.
<Combination>:
  • Combination containing the values to browse.
  • Combination variable containing the options to browse. All the options (active or inactive) are browsed.

Browsing the active options of a Combination variable Hide the details

FOR EACH <MyOption> OF <Combination>
    ...
END
<FOR EACH>:
Marks the beginning of the statement block.
<MyOption>:
Option Description variable corresponding to the combination option. There is no need to declare this variable.
<Combination>:
Combination variable containing the options to browse. Only the active options are browsed.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help