ALLIN
Returns TRUE if all elements from SEARCH exist also in LST. Items in LST list can contain wildcards.
Prototype
BOOL ALLIN (LIST SEARCH, LIST LST)
Returns
BOOL
Parameters
SEARCH
: The list with elements that are searched for.
LST
: The list where the elements are searched.
Returns TRUE if at least one element from SEARCH exists also in LST. Items in LST list can contain wildcards.
Prototype
BOOL ANYIN (LIST SEARCH, LIST LST)
Returns
BOOL
Parameters
SEARCH
: The list with elements that are searched for.
LST
: The list where the elements are searched.
Converts a string (VALUE) to a list by splitting it by the use of SEPAR sepa-rator. The separator is consumed by the function, which means the resulting list items do not contain it.
Prototype
LST EXPLODE (STR VALUE, STR SEPAR)
Returns
LST
Parameters
VALUE
: The string which is going to explode.
SEPAR
: The separator used for splitting VALUE.
Converts a list to string by joining list's element with SEPAR glue.
Prototype
STR IMPLODE (LIST LST, STR SEPAR)
Returns
STR
Parameters
LST
: The list that is converted to a string.
SEPAR
: The separator used for joining LST items.
Checks whether VAL value exists in LST list. This function always searches for values, never for keys. Items in the list can contain wildcards.
Prototype
BOOL IN (STR VAL, LIST LST)
BOOL IN(NUM VAL, LIST LST
)
BOOL IN(BOOL VAL, LIST LST)
Returns
BOOL
Parameters
VAL
: Number, string or bool value that is searched for in the list.
LST
: The list where the value is searched for.
Checks whether KEY key exists in LST list. If keys are used in the list then it compares keys. If the list uses automatic (i.e. numeric) keys then the key must be numeric. Items in the list can contain wildcards.
Prototype
BOOL KEYIN (STR KEY, LIST LST)
BOOL KEYIN (NUM KEY, LIST LST)
BOOL KEYIN (BOOL KEY, LIST LST)
Returns
BOOL
Parameters
KEY
: The key to search.
LST
: The list where the key is searched for.
Returns a list of keys used in the list passed as a parameter. This is useful mainly when the parameter is an associative list. By calling this function the keys can be transformed to a standard list. If the list passed as a parameter is not associative then the function returns a list of numbers, because num-bers are used as keys in non associative lists.
Prototype
LIST KEYS (LIST LST)
Returns
LIST
Parameters
LST
- The list from which keys are extracted.
Returns an associative list sorted by keys. This function fails when used with simple (non associative) list.
Prototype
LIST KSORT (LIST LST)
LIST KSORT (LIST LST, BOOL ASC)
Returns
LIST
Parameters
LST
: The original list.
ASC
: The sorting order. Use TRUE (default) for ascending sorting, FALSE for descending.
Returns a list that contains all elements of all lists passed as arguments. The function can be used both with standard lists (with automatic keys) or with associative lists. You can merge up to 5 lists by one function call. All lists that are merged must have the same type - they all must use automatic keys or be associative. A content of the lists passed as arguments is not affected by the function.
Prototype
LIST MERGE (LIST L1, LIST L2)
LIST MERGE (LIST L1, LIST L2, LIST L3)
LIST MERGE (LIST L1, LIST L2, LIST L3, LIST L4)
LIST MERGE (LIST L1, LIST L2, LIST L3, LIST L4, LIST L5)
Returns
LIST
Parameters
L1-L5
: The source lists.
When the lists use automatic indexes then the result contains all elements of the source lists. The first element has index 1, the last one has index equal to their count. In case of associative lists the key val-ues are important. If there are elements in the merged lists having the same key values, then such an element appears just once in the result and its value equals to the last one used
Example 1:
The value of X is: ['a','b','c','d','e','f','g','h','i']
Example 2:
The value of X is: ['a' => 'five', 'b' => 'two', 'c' => 'four']
Inserts a new value to the list. This function can be used only with lists hav-ing automatic indexes.
Prototype
VOID PUT(BOOL VAL, LIST LST)
VOID PUT(NUM VAL, LIST LST)
VOID PUT(STR VAL, LIST LST)
VOID PUT(LIST VAL, LIST LST)
Returns
VOID
Parameters
VAL
: The value that is inserted.
LST
: The list where the value is inserted.
Inserts a new pair or key and value to the list. This function can be used only with lists that use keys. If the key already exists in the list then it is set the new value.
Prototype
VOID PUT (BOOL KEY, BOOL VAL, LIST LST)
VOID PUT (BOOL KEY, NUM VAL, LIST LST)
VOID PUT (BOOL KEY, STR VAL, LIST LST)
VOID PUT (BOOL KEY, LIST VAL, LIST LST)
VOID PUT (NUM KEY, BOOL VAL, LIST LST)
VOID PUT (NUM KEY, NUM VAL, LIST LST)
VOID PUT (NUM KEY, STR VAL, LIST LST)
VOID PUT (NUM KEY, LIST VAL, LIST LST)
VOID PUT (STR KEY, BOOL VAL, LIST LST)
VOID PUT (STR KEY, NUM VAL, LIST LST)
VOID PUT (STR KEY, STR VAL, LIST LST)
VOID PUT (STR KEY, LIST VAL, LIST LST)
Returns
VOID
Parameters
KEY
: The key that is inserted.
VAL
: The value that is inserted.
LST
: The list where the key and value are inserted.
Inserts all items from the source list to the target one. The new items are appended at the end. This function can be used only with target lists having automatic indexes. Items in the source list can be of any type.
Prototype
VOID PUTALL (LIST SRC, LIST TRG)
Returns
VOID
Parameters
SRC
: The source list.
TRG
: The target list.
Example:
After calling putall the content of &A will be: [1,2,3,4,5,'x','y','z']
Inserts all items from the source list to the target one at the specified posi-tion. If the position if higher than the current number of elements of the target list then the new items are appended to its end. This function can be used only with target lists having automatic indexes. Items in the source list can be of any type.
Prototype
VOID PUTALLAT (LIST SRC, NUM POS, LIST TRG)
Returns
VOID
Parameters
SRC
: The source list.
TRG
: The target list.
NUM
: The position where items are inserted.
Example:
After calling putall the content of &A will be: [1,2,'x','y','z',3,4,5]
Inserts a new value to the list at POS position. Existing items at POS and higher positions are shifted.
Prototype
VOID PUTAT (BOOL VAL, NUM POS, LIST LST)
VOID PUTAT (NUM VAL, NUM POS, LIST LST)
VOID PUTAT (STR VAL, NUM POS, LIST LST)
VOID PUTAT (LIST VAL, NUM POS, LIST LST)
Returns
VOID
Parameters
VAL
: The value that is inserted.
POS
: The position where the new value is inserted.
LST
: The list where the new value is inserted.
Removes VAL value from the list. It always compare values, even when the list uses keys.
Prototype
VOID REM(BOOL VAL, LIST LST)
VOID REM(NUM VAL, LIST LST)
VOID REM(STR VAL, LIST LST)
Returns
VOID
Parameters
VAL
: The value that is removed.
LST
: The list from which the value is removed.
Removes a value from the list at specified position. If the list does not use keys then VAL must be a number and has a meaning of a position. Other-wise VAL has a meaning of key.
Prototype
VOID REMAT (BOOL VAL, LIST LST)
VOID REMAT (NUM VAL, LIST LST)
VOID REMAT (STR VAL, LIST LST)
Returns
VOID
Parameters
VAL
: The index or key that is removed.
LST
: The list from which the value is removed.
Returns a list that has items sorted in the reverse order. It can be used with normal as well as with associative lists.
Prototype
LIST REVERSE (LIST LST)
Returns
LIST
Parameters
LST
: The original list.
Returns TRUE if all pairs of a key and a value from L1 appear also in L2 and there is no key-value pair which exists only in one of the two lists.
Prototype
BOOL SAME (LIST L1, LIST L2)
Returns
BOOL
Parameters
L1
: One of the lists that are compared.
L2
: Another one of the lists that are compared.
Returns TRUE if all keys from L1 appear also in L2 and there is no key which exists only in one of the two lists.
Prototype
BOOL SAMEKEYS (LIST L1, LIST L2)
Returns
BOOL
Parameters
L1
: One of the lists that are compared.
L2
: Another one of the lists that are compared.
Returns TRUE if all values from L1 appear also in L2 and there is no value which exists only in one of the two lists.
Prototype
BOOL SAMEVALUES
(LIST L1, LIST L2)
Returns
BOOL
Parameters
L1
: One of the lists that are compared.
L2
: Another one of the lists that are compared.
Returns a number of elements in LST list.
Prototype
NUM SIZE (LIST LST)
Returns
BOOL
Parameters
LST
: The list whose size is returned.
Returns a list with sorted original list items. If it is used with associative lists then the result is sorted by values. If you need to sort by keys, use KSORT function instead.
Prototype
LIST SORT (LIST LST)
LIST SORT (LIST LST, BOOL ASC)
Returns
LIST
Parameters
LST
: The original list
ASC
: The sorting order. Use TRUE (default) for ascending sorting, FALSE for descending.
Returns a sublist of LST list. The new list contains elements starting at POS position of the original list. POS can be negative, then it measures from the end.
Prototype
LIST SUBLIST (LIST LST, NUM POS)
Returns
LIST
Parameters
LST
: The original list
POS
: The index from which the sublist starts
Returns a sublist of LST list. The new list contain max LEN elements of the original list starting from POS position. POS can be negative, then it measures from the end.
Prototype
LIST SUBLIST (LIST LST, NUM POS, NUM LEN)
Returns
LIST
Parameters
LST
: The original list .
POS
: The index from which the sublist starts .
LEN
: The number of elements the returned list contains .
SUBLIST function works only with lists with automatic numeric keys. It can't be used for lists with user-defined keys.
Returns a list of values used in the list passed as a parameter. The returned list is not associative. That means indexes in the returned list are numbers.
Prototype
LIST VALUES (LIST LST)
Returns
LIST
Parameters
LST
: The list from which values are extracted