|
|
|
|
|
- WLanguage properties that can be used with the List type
- WLanguage functions for managing lists
- The lists and the multithread
- Browsing the lists
- Special cases
List (Variable type) In french: Liste (Type de variable)
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.
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 including the arrays, the associative arrays, the queues, the stacks and the lists. For example: <variable> est une Liste de tableaux d'entiers
<variable> est une Liste de tableaux fixes de 5 entiers
<variable> est une Liste de tableaux associatifs d'entiers
<variable> est une Liste de Files d'entiers
<variable> est une Liste de Piles d'entiers
<variable> est une Liste de Listes d'entiers Properties WLanguage properties that can be used with the List type The following properties can be used to handle List variables. | | Property name | Effect |
---|
Empty | - True if the list is empty,
- False otherwise.
| Occurrence | Returns the number of occurrences of the List variable. |
Remarks WLanguage functions for managing lists The following functions can be used to handle List variables.
| | Add | Adds an element in last position: - of a one-dimensional WLanguage array.
- of an advanced array property (array of gglCalendar events, ...).
- from a WLanguage list.
| Delete | Deletes an element at a given position: - from a one-dimensional WLanguage array.
- from an advanced array property (array of gglCalendar events, etc.).
- from an associative array.
- from a WLanguage list.
| DeleteAll | Deletes all elements: - from a one-dimensional or two-dimensional WLanguage array.
- from an associative array.
- from an advanced array property (array of gglCalendar events, etc.).
- from a WLanguage queue.
- from a WLanguage stack.
- from a WLanguage list.
| Deserialize | Deserializes a buffer or a character string containing the data from a class, structure, array (including an associative array), queue, stack, list or advanced variable, as well as their subelements. | 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, etc.).
- into a WLanguage list.
| ListInfo | Retrieves the characteristics of a WLanguage list: element types and number of elements. | Serialize | Transforms the following elements into a specific format:- a structure (and its subelements),
- a class (and its subelements),
- 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 MaListe.Occurrence > 0 THEN
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: POUR TOUT [ELEMENT] <Variable> [, <Compteur> [, <Compteur>]] DE <Liste> [<Sens>] ... FIN 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:
Insère(<Nom de la liste>, AvantElémentCourant, <Valeur>) Caution: the element will be browsed by the next iteration if the loop is descending. - Syntax 2:
Insère(<Nom de la liste>, AprèsElémentCourant, <Valeur>) Warning: the element will be traversed by the next iteration if the loop is ascending. - Syntax 3:
Supprime(<Nom de la liste>, ElémentCourant)
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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|