The %Collection.ListOfDT class represents a list of literal (i.e., data type) values
each of which is associated with a numeric position in the list.
The first element in the list is stored at position 1.
You can use a list object as follows:
Set list=##class(%ListOfDataTypes).%New()
; add items to the list
Do list.Insert("Harpo")
Do list.Insert("Groucho")
Do list.Insert("Chico")
Do list.Insert("Karl")
; iterate over contents of list
For i=1:1:list.Count() Write list.GetAt(i),!
These %Collection classes can only be used when you have a collection property of another object as they rely on
storing the data inside the parent object, they can not be used as 'stand alone' collections, for this use the %ListOfDataTypes.
Starting from, and including, position key, Find finds
the next element in the list with value equal to element.
If key is a null string, Find starts at the beginning
of the list.
Find returns the position of the found element or
null string ("") if no element was found.
Finds and returns the value of the element at the position after key
in the list. If key is a null string (""), it returns
the value of the first element in the list.
The value of key, which is passed by reference, is updated to the position
value of the returned element or null string ("") if key
is at the end of the list.
Finds and returns the value of the element at the position before key
in the list. If key is a null string (""), it returns
the value of the last element in the list.
The value of key, which is passed by reference, is updated to the position
value of the returned element or null string ("")
if key is at the beginning of the list.
Inserts an element with value element into the list at the correct ordered
position. The elements in the list are shifted to accommodate the new element as necessary.
Returns a %Status value indicating success or failure.
Finds and returns the index value of the element at the location following key in the list.
If key is a null string (""), then Next returns the position of the first element in the list (1).
Finds and returns the index value of the element at the location preceding key in the list.
If key is a null string (""), then Next returns the position of the last element in the list.