%Collection.AbstractArray
abstract class %Collection.AbstractArray extends %Collection.AbstractIterator
An array collection represents an array of data type elements, each of which is associated with a unique key value. Keys can have any value, string or numeric.The %Collection.AbstractArray class provides the basic functionality of the various array collection classes.
The non-abstract array classes derived from %AbstractArray include %ArrayOfDataTypes, %ArrayOfObjects, %Collection.ArrayOfObj and %Collection.ArrayOfDT.
You can use an array object as follows:
Set arr=##class(%ArrayOfDataTypes).%New() ; place items into the array Do arr.SetAt("red","color") Do arr.SetAt("large","size") Do arr.SetAt("expensive","price") ; iterate over contents of array Set key="" For Set value=arr.GetNext(.key) Quit:key="" Write key,":",value,!
Method Inventory
- %IsNull()
- BuildValueArray()
- Clear()
- Count()
- Define()
- Find()
- GetPrevious()
- IsDefined()
- LogicalToOdbc()
- OdbcToLogical()
- Previous()
- RemoveAt()
- SetAt()
Parameters
Methods
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.
Please use IsDefined() instead.
If key is a null string (""), the search starts at the beginning of the array.
Find returns the key associated with the found element or null string ("") if no element is found.
The value of key, which is passed by reference, is updated to the key value of the returned element or null string ("") if key is at the beginning of the array.
RemoveAt returns the value of the removed element or null string ("") if no element was removed.
Returns a %Status value indicating success or failure.