ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Table functions
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
TableMode (Function)
In french: TableMode
Warning
TableMode is kept for backward compatibility.
In this version, the tables based on a data file are automatically browsed: the number of records to display corresponds to the total number of records in the file.
Below is the documentation of TableMode.
 
Purpose
Modifies the management mode of vertical scrollbar in a table based on a data file to get:
  • a scrollbar corresponding to the position of current record in the file.
  • a fixed scrollbar.
Remark: TableMode can be used on a single-selection or multi-selection table.
Syntax
<Result> = TableMode(<Table name>, <Scrollbar mode> [,<Value>])
  • <Result> is an integer containing the management mode of specified scrollbar.
  • <Table name> is a character string that corresponds to the name of Table control to use. If this parameter corresponds to an empty string (""), the table to which the current process belongs will be used.
  • <Scrollbar mode> is a character string used to specify the management mode of vertical scrollbar:
    • "NbRec": The number of records to display is fixed.
    • "Auto": Calculates the number of records to display.
    • "All": The number of records to display corresponds the total number of records in the file.
    • "Fixed": The scrollbar box is fixed.
    • "Position": Positions the selection bar.
  • <Value> is an optional integer that depends on <Scrollbar mode>.
Notes
The number of records to display is fixed: "NbRec"
TableMode called with "NbRec" is used to define an "approximate" number of records. This number of records may not correspond to the actual number of records to view in the table.
<Result> = TableMode(<Table name>, "NbRec" [,<Nb of records>])
If <Nb of records> is not specified, the number of fixed records will be the total number of active records in the file (returned by HNbRec).
<Result> contains:
  • the number of records <Number of records> if the function was successful.
  • 0 if an error occurs.
The call to TableMode with the "NbRec" parameter reinitializes the table and positions on the first record to display.
To display all records in the table, TableMode, with the "NbRec" parameter, uses the "Next record" and "Previous record" processes.
<Number of records>:
  • must not be specified if the number of records is important and if one of the "initialization", "next" or "previous" processes of table contain specific code (if one of these processes manages a filter procedure for example).
  • must be specified if a filter is managed by HFilter. In this case, the number of records taken as reference is the total number of records (while ignoring the filter).
  • must be specified if the number of records to display is known.
The number of records to display is calculated: "Auto"
TableMode called with the "Auto" parameter is used to automatically calculate the number of records to display by browsing the file beforehand (by running the "Initialization" and "Next record" processes of table).
<Result> = TableMode(<Table name>, "Auto")
<Result> contains:
  • the number of records found corresponding to the number of records to display.
  • 0 if an error occurs.
TableMode called with "Auto" reinitializes the table and positions on the first record to display.
To display all records in the table, TableMode,with the "Auto" parameter, uses the "Next record" and "Previous record" processes.
Tip: The pre-browse operation can take a few minutes if there is an important number of records to display. In this case, you should prefer the "Fixed" mode or the "NbRec" mode.
The number of records to display is the total number of records in the file: "All"
TableMode called with "All" is used to view all file records.
<Result> = TableMode(<Table name>, "All")
<Result> contains the number of file records.
In this mode, the table browse switches to "Automatic" mode (no call to the browse processes).
Important:
  • If a filter was defined on the file by HFilter, the number of file records (returned in <Result>) will be greater than or equal to the number of records that will be viewed in the table. Indeed, the number of records is the one given by HNbRec (that ignores the filter).
  • The "All" parameter must not be used if a browse filter is managed by a procedure. Indeed, in this case, the filter test will not be taken into account because the table processes will not be run.
Pressing Ctrl + End is used to position the table bar onto the last file record.
Tip: This mode is the default mode for the tables in WINDEV.
The scrollbar box is fixed: "Fixed"
TableMode called with "Fixed" is used to create a scrollbar with a fixed box that does not represent the position of current row in the file.
In this mode, the scrollbar box allows you to move forward/backward one entire page at a time.
<Result> = TableMode(<Table name> , "Fixed")
<Result> contains:
  • 1 if the function was successfully run.
  • 0 if an error occurs.
In the window editor, if the table was described with an "Automatic" vertical scrollbar, the table scrollbar is managed with the "Fixed" parameter).
Positioning the selection bar on a given row: "Position"
TableMode called with the "Position" parameter is used to define or find out the bar position in the table.
<Result> = TableMode(<Table name> , "Position" [,<row>])
<Result> contains the row number.
If the <Row> parameter:
  • is specified, TableMode defines the position.
  • is not specified, TableMode returns the position.
This syntax is equivalent to TableSelect and TableSelectPlus.
Important: The position of the selection bar in the Table control is given in relation to the first row to display. To position oneself on the first row at the beginning of the Table control, press Ctrl + Home.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help