PC SOFT

WINDEV的在线文档

  • Overview
  • Initializing a memory Table control
  • Adding rows into a memory Table control
  • Managing the calculated columns
  • Modifying a row or a column
  • Forcing the input
  • Adding or deleting a column
  • Operations on the rows and cells
  • Deleting a row
  • Selecting the row
  • Retrieving the content of a row or the content of a cell
  • Value of a cell in the current row
  • Value of a cell in a specific row
  • Content of the current row
  • Content of a specific row
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Programming the memory Table controls

Overview
The main concepts for programming the memory Table controls are as follows.

Several WLanguage functions allow you to manage this type of control by programming. Do not hesitate to see the documentation about these functions.

See Functions for managing the Table controls for more details.

Initializing a memory Table control
The creation of a row in a Table control is not automatically performed. It must be explicitly requested via a call to:Note: if the cascading input is not selected:
  • A Table control contains no row when it is created: TABLE_MyTable..数目=0.
    In this case, no input is allowed and ..空 is set to .
  • To automatically insert a row if the Table control is empty, the following command lines must be used in the initialization process of the Table control:
    如果TABLE_MyTable..空=,那么表格添加TABLE_MyTable

Adding rows into a memory Table control
Adding rows into a memory Table control is performed:
WinDev If a new row was added into the Table control by 表格添加, 表格插入, 表格添加行 or 表格插入行, ..新建 is set to (otherwise, it is set to ).

Managing the calculated columns
The calculation formula of a calculated column must be described in the "Displaying a table row" process. For example:

// COL_PBT: calculated column
// COL_UPBT and COL_QTY: columns linked to memory zones
COL_PBTCOL_UPBT*COL_QTY

Modifying a row or a column
The content of a Table control's rows or columns can be modified:
  • by the user, by performing an input in the columns. The modifications are automatically stored in the Table control with no additional programming. ..已修改 is set to .
  • by programming:
    • with 表格修改 to modify the content of the current row or the content of a given row.
      For example:
      表格修改TABLE_CUSTOMER"MOORE"+TAB+"Vince"+TAB+"Miami"

      Note: you can also use the name of the Table control directly:
      // Modify the current row
      TABLE_CUSTOMER"MOORE"+TAB+"Vince"+TAB+"Miami"
      // Modify row 3
      表格修改TABLE_DAY"Wednesday"+TAB+"Off"3
    • by specifying the name of the column (like for an edit control) to modify the content of the column. To modify a column of a specific row, the number of the row must be specified (subscript).
      For example:
      COL_NAMESubscript】=EDT_CustomerName

      To modify a column of the current row, there is no need to specify the subscript. For example:
      COL_NAMEEDT_CustomerName

      ..已修改 is set to (it is set to when an input is performed in the Table control).

WinDevWindows用户代码(MCU)

Forcing the input

重新输入 can be used to force the input in a column of the current row.

For example:

// Entry process in the COL_QTY column
// COL_QTY cannot be entered,
// if COL_PRODUCT is not entered
如果无空格COL_PRODUCT)="",那么
错误"The Product column must be entered first"
重新输入COL_PRODUCT
结束

WinDevWindows用户代码(MCU)

Adding or deleting a column

You have the ability to:
  • Add a column into a memory Table control with 控件克隆.
  • Delete a column from a memory Table control with 控件删除.

Operations on the rows and cells

Deleting a row

The deletion of a row must be explicitly requested by 表格删除. The following syntax is used:
表格删除(<Name of Table Control> [, <Subscript>])

If the subscript is specified, 表格删除 deletes the row corresponding to the subscript. Otherwise, the current row is deleted. For example:
表格删除TABLE_CUSTOMER

The deletion of a Table control row also deletes all the values of the columns for this row.

Selecting the row

The selection of a row is performed by 表格选择行.

The following syntax is used:

表格选择行(<Name of Table Control>[, <Subscript>])

Retrieving the content of a row or the content of a cell

The content of a memory table can be retrieved:
  • for the entire row.
  • cell by cell.

Value of a cell in the current row

To retrieve the value of a column (or cell) for the current row, the syntax is the same as for a simple edit control.

<Value> = <Column_Name>

Example:

// COL_QTY is a column of the Table control
如果COL_QTY小于10,那么
信息"Insufficient quantity"
结束

Value of a cell in a specific row

To retrieve the value of a column not found on the current row, the subscript of the row must be specified.

<Value> = <Column_Name>[<Subscript>]

For example:

// Add the total price before tax (PBT) for all the order lines
TotalPrice0
对于Subscript1最优直到TABLE_ORDERS..数目
TotalPriceTotalPrice+COL_PBTSubscript
结束

Content of the current row

To retrieve the content of the current row, use the following syntax:

<Value> = <TableName>

Content of a specific row

To retrieve the content of the row whose subscript is <Subscript>, use the following syntax:

<Value> = <Table_Name>[<Subscript>]

Note: The subscript of the current row is returned by 表格选定行. For example:

// Retrieve row #10 in the TABLE_CUSTOMER control
CurrentRowTABLE_CUSTOMER10

// Name of selected customer
CustomerNameCOL_NAME表格选定行TABLE_CUSTOMER)】

// Retrieve the current row in the TABLE_CUSTOMER control
CurrentRowTABLE_CUSTOMER