|
|
|
|
|
- Adding an element
- Miscellaneous
ArrayAddSorted (Function) In french: TableauAjouteTrié Adds an element to a one-dimensional WLanguage array taking into account: - the sort criteria defined by ArraySort
- the comparison operator described in the class, if the elements of the array are class instances.
MonTableau is array of 2 strings
MonTableau[1] = "WINDEV"
MonTableau[2] = "WEBDEV"
ArraySort(MonTableau, asAscending)
ArrayAddSorted(MonTableau, "WEBDEV et WINDEV")
Trace(MonTableau[1])
Trace(MonTableau[2])
Trace(MonTableau[3])
Syntax
<Result> = ArrayAddSorted(<WLanguage array> , <Element value>)
<Result>: Integer - Index at which the specified element was added,
- -1 if the element could not be added.
A WLanguage error occurs if: - no sort criteria have been defined (ArraySort function or comparison operator in the class).
- the array did not meet the sort criteria before the addition.
<WLanguage array>: Array Name of the Array variable to use. This array must be a one-dimensional array. <Element value>: Type of array elements Element that must be added to the specified array. Remarks Adding an element When ArrayAddSorted is called: - the array is automatically enlarged to receive the new element.
- the element is converted (if necessary) into the type of the other array elements.
- the element is placed in the array according to the sort.
Miscellaneous This function cannot be used on: - non-created arrays,
- fixed arrays.
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|