PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • WLanguage properties that can be used with the List type
  • WLanguage functions for managing the lists
  • The lists and the multithread
  • Browsing the lists
  • Special cases
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
A List variable is a structured type that is used to group a set of elements of the same type. The elements can be added at the end of the list or they can be inserted into the list.
Versions 18 and later
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
New in version 18
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
iPhone/iPad This type of variable is now available for the iPhone/iPad applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Android This type of variable is now available for the Android applications.
Android Widget This type of variable is now available in Android Widget mode.
WINDEVJava This type of variable is now available for the Java applications.
Apple Watch This type of variable is now available in Apple Watch mode.
New in version 21
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Android This type of variable is now available for the Android applications.
Android Widget This type of variable is now available in Android Widget mode.
WINDEVJava This type of variable is now available for the Java applications.
Apple Watch This type of variable is now available in Apple Watch mode.
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Android This type of variable is now available for the Android applications.
Android Widget This type of variable is now available in Android Widget mode.
WINDEVJava This type of variable is now available for the Java applications.
Apple Watch This type of variable is now available in Apple Watch mode.
Syntax

Declaring and initializing a list Hide the details

<List Name> is List of <Type of List Elements>
<List Name>:
Name of the List variable to declare.
<Type of List Elements>:
Type of the elements found in the list.
All types of variables can be used EXCEPT for the arrays, the associative arrays, the queues, the stacks and the lists.
Versions 20 and later
All types of variables can be used including the arrays, the associative arrays, the queues, the stacks and the lists. For example:
<variable> is List of arrays of int

<variable> is List of fixed arrays of 5 int

<variable> is List of associative arrays of int

<variable> is List of Queues of int

<variable> is List of Stacks of int

<variable> is List of Lists of int
New in version 20
All types of variables can be used including the arrays, the associative arrays, the queues, the stacks and the lists. For example:
<variable> is List of arrays of int

<variable> is List of fixed arrays of 5 int

<variable> is List of associative arrays of int

<variable> is List of Queues of int

<variable> is List of Stacks of int

<variable> is List of Lists of int
All types of variables can be used including the arrays, the associative arrays, the queues, the stacks and the lists. For example:
<variable> is List of arrays of int

<variable> is List of fixed arrays of 5 int

<variable> is List of associative arrays of int

<variable> is List of Queues of int

<variable> is List of Stacks of int

<variable> is List of Lists of int
Remarks

WLanguage properties that can be used with the List type

The following properties can be used to handle a List variable.
Property nameEffect
OccurrenceReturns the number of occurrences of the List variable.
Empty
  • True if the list is empty,
  • False otherwise.
Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

WLanguage functions for managing the lists

The following functions can be used to handle a List variable.
Versions 14 and later
Add
New in version 14
Add
Add
Adds an element in last position:
  • of a one-dimensional WLanguage array.
  • of an advanced array property (array of events of gglCalendar, ...).
  • from a WLanguage list.
Versions 14 and later
Delete
New in version 14
Delete
Delete
Deletes an element at a given position:
  • from a one-dimensional WLanguage array.
  • from an advanced array property (array of gglCalendar events, ...).
  • from an associative array.
  • from a WLanguage list.
Versions 14 and later
DeleteAll
New in version 14
DeleteAll
DeleteAll
Deletes all the elements:
  • from a one-dimensional or two-dimensional WLanguage array.
  • from an associative array.
  • from an advanced array property (array of gglCalendar events, ...).
  • from a WLanguage queue.
  • from a WLanguage stack.
  • from a WLanguage list.
Versions 10 and later
Deserialize
New in version 10
Deserialize
Deserialize
Deserializes a buffer or a character string containing the data of a class, structure, array (including an associative array), queue, stack, list or advanced variable as well as their sub-elements.
Versions 14 and later
Insert
New in version 14
Insert
Insert
Inserts an element at a given position:
  • into a one-dimensional WLanguage array.
  • into an associative array.
  • into an advanced array property (array of gglCalendar events, ...).
  • into a WLanguage list.
Versions 16 and later
ListInfo
New in version 16
ListInfo
ListInfo
Retrieves the characteristics of a list: types of elements and number of elements.
Versions 10 and later
Serialize
New in version 10
Serialize
Serialize
Transforms the following elements into a specific format:
  • a structure (and its sub-elements),
  • a class (and its sub-elements),
  • an array (including the associative arrays),
  • a queue,
  • a stack,
  • a list.

The lists and the multithread

The management of multithread is taken into account when adding, inserting and deleting an element.
You also have the ability to use properties during a multithread management but the result is not permanent. For example:
IF MyList..Occurrence > 0 THEN
// The list may be empty when the thread reaches this point
END

Browsing the lists

The FOR EACH syntax can be used to browse the lists.
The syntax used corresponds to the one used for the arrays:
FOR EACH [ELEMENT] <Variable> [, <Counter> [, <Counter>]] OF <List> [<Direction>]
...
END
The elements can be modified during the browse. If the list is modified during a browse, the browse is affected by the additions and by the deletions. The functions available during the browse are as follows:
  • Syntax 1:
    Insert(<List Name>, BeforeCurrentElement, <Value>)

    Caution: the element will be browsed by the next iteration if the loop is a descending loop.
  • Syntax 2:
    Insert(<List Name>, AfterCurrentElement, <Value>)

    Caution: the element will be browsed by the next iteration if the loop is an ascending loop.
  • Syntax 3:
    Delete(List Name, CurrentElement)

Special cases

  • The content of the list can be displayed in the debugger.
  • A list can be used to type a procedure parameter.
  • A list can be copied by the = operator. You also have the ability to copy an instance of class or structure containing a list.
  • A list can be initialized by a list of elements.
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment