%Library.DynamicArray
class %Library.DynamicArray extends %Library.DynamicAbstractObject
Dynamic Array type classMethod Inventory
Methods
key The index position of the value you wish to retrieve, indexes begin at position 0. This must be passed as a canonical integer value.
Returns The value of the data as defined by index position 'key'. If the value does not exist, a null string "" is returned. You can differentiate between an unassigned value that returns a "" string and a real "" string using %GetTypeOf()
Perform an iteration of all the values in a %DynamicAbstractObject subclass.
In the example below, we will output all values contained in a %DynamicObject.
set iter = obj.%GetIterator() while iter.%GetNext(.key , .value ) { write "key = "_key_" , value = "_value,! }
key The index position of the value you wish to test, indexes begin at position 0. This must be passed as a canonical integer value.
Returns A boolean value to show if a value is defined (1) or not (0).
Note: Any of the 4 situations causes %Pop() to return the empty string, "":
- (1) Popping from an empty array
- (2) Last member is the empty string
- (3) Last member is the value null
- (4) Last member is unassigned
If you want to differentiate between these 4 cases then you must test the array and its last element before calling the %Pop method.
Returns The value of the last member of the array.
If the array is empty, the method returns the empty string, "".
Given a new value, append it to the end of the current array, increasing the length of the array.
value The new value to push.
type OPTIONAL, the type of the value to push.
If the type argument is present then it must be one
of the following strings:
"null" - JSON null, must be ""
"boolean" - Either 0 or nonzero integer
"number" - Convert to numeric value
"string" - Convert to text string
Returns An oref referencing the current modified array, allowing calls to %Push() to be chained.
pos Index position within the %DynamicArray of the element you wish to remove
Returns The value of the removed %DynamicArray element.
key The index position of the value you wish to create , indexes begin at position 0. This must be passed as a canonical integer value.
value The new value with which to update the previous value or create a new value.
type OPTIONAL, the type of the value being assigned.
If the type argument is present then it must be one
of the following strings:
"null" - JSON null, must be ""
"boolean" - Either 0 or nonzero integer
"number" - Convert to numeric value
"string" - Convert to text string
Returns An object to the current modified array, allowing calls to $set() to be nested.
Inherited Members
Inherited Methods
- %ClassIsLatestVersion()
- %ClassName()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %FromJSON()
- %GetIterator()
- %GetParameter()
- %GetTypeOf()
- %IsA()
- %New()
- %OnClose()
- %OriginalNamespace()
- %PackageName()
- %SetModified()
- %Size()
- %ToJSON()