PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
TableMode (Function)
In French: TableMode
TableMode is kept for backward compatibility.
In this version, the browsing tables are automatically browsed: the number of records to display corresponds to the total number of records in the file.
The documentation about TableMode ia as follows.
 
Purpose
Modifies the management mode of the vertical scrollbar in a browsing table to have:
  • a scrollbar that corresponds to the position of the current record in the file.
  • a fixed scrollbar.
Note: 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 the specified scrollbar.
  • <Table Name> is a character string corresponding to the name of the 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 the 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 occurred.
The call to TableMode with the "NbRec" parameter re-initializes the table and positions on the first record to display.
To display all the records in the table, TableMode called with "NbRec" is using 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 the 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 "Initializing" 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 occurred.
TableMode called with "Auto" re-initializes the table and positions on the first record to display.
To display all the records in the table, TableMode called with "Auto" is using 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 the 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 test of the filter will not be taken into account because the processes of the table will not be run.
[Ctrl]+[End] is used to position the table bar on 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 the current row in the file.
In this mode, the scrollbar box enables 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 occurred.
In the window editor, if the table was described with an "Automatic" vertical scrollbar, the scrollbar of the table 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 position of bar 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 selection bar in the table is absolute. Which means that the position is given in relation to the first row to display. To position on the first row at the beginning of table, press [CTRL]+[Home).
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment