ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Operating mode of FileToMemoryList
  • Modifying the properties associated with the List Box control
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
FileToMemoryList (Function)
In french: FichierVersListeMémoire
Populates a List Box or Combo Box control programmatically with the records from a data file or query. The List Box control or Combo Box control are not emptied before being filled with the contents of the data file or query.
Example
// Add the "<None>" element to the List Box control named "LIST_Customer"
// When the user selects this element, 
// the value "-1" will be returned
ListAdd(LIST_Customer, "<None>" + gStoredValue("-1"))
// Add after the "<None>" element,
// the customer names contained in the "Customer" data file
FileToMemoryList(LIST_Customer, CUSTOMER, NAME, NAME, CUSTOMERID)
Syntax
FileToMemoryList(<List Box control> [, <Data file name> [, <Name of displayed item> [, <Name of sort item> [, <Name of stored item>]]]])
<List Box control>: Character string
Name of the List Box or Combo Box control to be populated.
<Data file name>: Optional character string
Name of data file (or query) used. If this parameter is not specified, the name of the data file used corresponds to the one specified when creating the control ("Content" tab in the description window of control).
Content tab of control
<Name of displayed item>: Optional character string
Name of the data file (or query) item that will be displayed in the List Box or Combo Box control.
If this parameter is not specified, the name of displayed item corresponds to the one specified when creating the control ("Content" tab in the description window of control).
If this parameter is not specified and if the "Content" tab is not filed, the displayed item corresponds to:
  • the last item used in the data file.
  • the first column of query.
<Name of sort item>: Optional character string
Name of item used to sort the elements in the List Box or Combo Box control. If this parameter is not specified, the name of the sort item will be the one specified when the control was created ("Content" tab in the control description window).
<Name of stored item>: Optional character string
Name of the item that will be used in the code when an element is selected in the List Box or Combo Box control.
If this parameter is specified, the value added in the List Box or Combo Box control is:
<Name of displayed item> + gStoredValue(<Name of stored item>)

If this parameter is not specified, <Name of stored item> corresponds to <Name of displayed item>.
PHP This parameter is ignored because List Box and Combo Box controls populated programmatically do not have stored values in PHP.
Remarks

Operating mode of FileToMemoryList

The function FileToMemoryList fills the field List with all the records from <Data file name> sorted on <Sort field name>. If a filter is found on this item, this filter is taken into account.

Modifying the properties associated with the List Box control

The following properties are modified by this function:

Miscellaneous

  • The List Box (or Combo Box) control is not cleared before being populated.
  • This function cannot be used on a Table field: we recommend using the FileToMemoryTable function.
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/08/2024

Send a report | Local help