Feedback

  • Contents
 

List Operators

GetAt

GetAt (ANY_LIST_TYPE, Integer)

Retrieves the value of a specific element in a list of any type. The value retrieved is of the same type as the list. If the position you are retrieving from is empty, or if the element does not exist, this operation will return a null value.

Example: The ListofString contains "dog" in position zero, "cat" in position one, and "mouse" in position two. GetAt (ListofString, 1) results in a string with a value of "cat".

If there is no value at the specified position, this operation will return one of the following default values:

  • List of Integer - 0

  • List of Numeric - 0

  • List of Boolean - false

  • List of String - ""

  • List of DateTime - Jan 1, 1970, 0,0,0

Note: There is no way to tell if a GetAt failed or succeeded and the value is just default unless you check the value returned by a GetCount.

GetHead

GetHead (ANY_LIST_TYPE)

Retrieves the value of the first element in a list of any type. The value retrieved is of the same type as the list. If the position you are retrieving from is empty, or if the element does not exist, this operation will return a null value.

Example: The ListofString contains "dog" in position zero, "cat" in position one, and "mouse" in position two. GetHead (ListofString) results in a string with a value of "dog".

If there is no value at the specified position, this operation will return one of the following values:

  • List of Integer - 0

  • List of Numeric - 0

  • List of Boolean - false

  • List of String - ""

  • List of DateTime - Jan 1, 1970, 0,0,0

Note: There is not way to tell if a GetHead failed or succeeded and the value is just 0 unless you check the value returned by a GetCount.

GetTail

GetTail (ANY_LIST_TYPE, ANY_LIST_TYPE)

Retrieves the value of the last element in a list of any type. The value retrieved is of the same type as the list. If the position you are retrieving from is empty, or if the element does not exist, this operation will return a null value.

Example: The ListofString contains "dog" in position zero, "cat" in position one, and "mouse" in position two. GetTail (ListofString) results in a string with a value of "mouse".

If there is no value at the specified position, this operation will return one of the following values:

  • List of Integer - 0

  • List of Numeric - 0

  • List of Boolean - false

  • List of String - ""

  • List of DateTime - Jan 1, 1970, 0,0,0

Note: There is not way to tell if a GetTail failed or succeeded and the value is just 0 unless you check the value returned by a GetCount.

GetCount

GetCount (ANY_LIST_TYPE, Integer)

Counts the number of elements in a list and returns that count as an integer value.

Example: The ListofString contains the "dog" in position zero, "cat" in position one, and "mouse" in position two. GetCount (ListofString) results in an Integer with a value of three.

Find

Find (ANY_LIST_TYPE, ANY_SIMPLE_TYPE, Integer)

Looks for a specific value in a list of values of the same type. The position of the first matching value is returned as an integer value. The input integer value is the number of elements in the list to skip before starting the search. To skip the first three elements in a list, you would use the input integer value of three. If the find operation is unsuccessful, this operation returns –1.

Example: The ListofString contains "dog" in position zero, "cat" in position one, and "mouse" in position two. Find (ListofString, "Cat",0) results in an output of 1. In another example, the ListofString contains "apple" in position zero, "orange" in position one, "banana" in position two, and "apple" in position three. Find (ListofString, "apple", 2) results in an output of 3.