PC SOFT

WINDEV的在线文档

  • Syntax 1: Browsing the control elements
  • Syntax 2: Browsing the selected control elements
  • Browsing the rows of a Table control
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

对于每个 is used to perform different types of browse operations on 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 对于每个 statement but it can be replaced by FOR ALL.

Limitation: This statement cannot be used on the Combo Box controls.

15版本和更高版本
The FOR EACH statement can also be used to browse the .Net objects that implement the IEnumerable interface.
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.

18版本和更高版本
WinDevWindows Store apps This feature is available in Windows Store apps mode.
18新版本
WinDevWindows Store apps This feature is available in Windows Store apps mode.
WinDevWindows Store apps This feature is available in Windows Store apps mode.

例子
// For each user selected in TABLE_User
对于TABLE_User中每一行
// Send an email
Proc_发送消息COL_NameCOL_Email
结束

语法

Browsing the control elements (Table, List Box and Looper) 隐藏详细信息

 对于 EACH ROW [<Subscript> [, <Counter>]] OF <Control>

    ...
END

<FOR EACH ROW>:
Marks the beginning of the 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.

Windows Store apps The Table controls are not available.

Browsing the selected elements 隐藏详细信息

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

    ...
END

<FOR EACH SELECTED ROW>:
Marks the beginning of the 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.

Windows Store apps The Table controls are not available.

注意

Syntax 1: Browsing the control elements

This syntax is used to browse all the rows, visible or not, found in a list box, in a table or in a looper.

For each row browsed:

  • <Control Name> returns the subscript of the current row. <Subscript> 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 value of the column 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 found in 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 the current selected row.
  • <Control Name>[<Control Name>] returns all the columns separated by TAB characters.
  • <Column Name> returns the value of the column for the row currently browsed. You also have the ability to 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. 多任务重绘 is ignored.
  • the selected rows and/or the current row must not be modified (表格取消选择行, 表格选择行, ...).
  • for a browsing Table control, in the browse loop, the current record is the record processed by the browse.
Windows Store apps Reminder: The Table controls are not available.