ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Indexed control
  • Code of the indexed control
  • Handling an indexed control directly (assignment, ...)
  • Edit control or column in a Table control
  • Column of Table control
  • Remarks: Indexed column and non-indexed column
  • Operating mode of the FileToScreen and ScreenToFile functions
  • WLanguage properties and indexed controls
  • WLanguage functions specific to the management of indexed controls
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
Code of the indexed control
All the indexed controls with the same name are associated with the same processes.
For example, the initialization code of the indexed control named EDT_Edit1[1] is the same as the initialization code of the indexed control named EDT_Edit1[5].
Handling an indexed control directly (assignment, ...)

Edit control or column in a Table control

To handle an indexed control through programming, the index must be specified.
For example: IndexedControl[1] to handle the first indexed control.

Column of Table control

The columns of a Table control can be indexed: the Table control includes several columns with the same name. Each column is identified by its name and index.
To retrieve the value of an indexed column in a Table control, the syntax is as follows:
Value = <Column name>[<Row>, <Index>]
To assign a value to an indexed column in a Table control, use the following syntax:
<Column name>[<Row>, <Index>] = Value
with:
  • <Column name>: name of the indexed column.
  • <Row>: row number
  • <Index>: index of the column.
Example: A Table control contains an indexed column (COL_Address). Two columns are associated with Address. To handle these columns, use the following syntax:
// Assigns the row 1 of COL_Address[2]
COL_Address[1,2] = "3 main street"
// Changes the background color of row 5 in COL_Address[1]
COL_Address[5,1].BackgroundColor = LightGreen
// Changes the background color of row 4 in COL_Address[2]
COL_Address[4,2].BackgroundColor = LightGreen

Remarks: Indexed column and non-indexed column

  • For indexed columns:
    <Column name>[Index n] returns the content of the column at index n on the current row.
  • For non-indexed columns:
    <Column name>[Index n] returns the content of the column on row n.
  • <Column name>[<Row>][<Index>] is equivalent to <Column name>[<Row>,<Index>]
Operating mode of the FileToScreen and ScreenToFile functions
FileToScreen and ScreenToFile automatically manage the link between indexed controls and array items. The indexed control must be associated with one of the elements of the array item.
WLanguage properties and indexed controls
The following syntax is used to access a property of an indexed control:
<ControlName>[<Index>].<Property>

<Column name>[<Type of calculation>].<Property>
  • <ControlName> is the name of the control
  • <Index> is the index of the control (the index is set to 1 by default)
  • <Property> is one of the properties proposed by WINDEV.
For an indexed control, <Control name>.<Property> only assigns a value to the control whose index is set to 1.
All the properties available for edit controls and columns of Table controls can be used on indexed controls.
The properties apply to each control and not to all the controls of the indexed control.
WLanguage functions specific to the management of indexed controls
The following functions are used to manage indexed controls:
CurrentColumnReturns the index of the current indexed column in a Table control based on a data file or in a Table control populated programmatically.
CurrentIndexReturns the index of the current control.
NextIndexReturns the number of the next row displayed in the current Table control.
Returns the index of the next indexed control.
ScreenFirstDefines the next control that will be in edit in the current window.
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help