Array Class
Syntax
class Array extends Object
Run On
Called
Methods
Method | Description | |
---|---|---|
cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) | |
definitionString | Returns a string that contains the definition of the array. | |
equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) | |
exists | Determines whether a particular array element is valid. | |
getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) | |
handle | Retrieves the handle of the class of the object. (Inherited from Object.) | |
lastIndex | Retrieves the highest index that is used to store a value in the array. | |
new | Creates an array in which each element has the specified type. (Overrides the new Method.) | |
notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) | |
notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) | |
objectOnServer | Determines whether the object is on a server. (Inherited from Object.) | |
owner | Returns the instance that owns the object. (Inherited from Object.) | |
pack | Serializes the current instance of the Array class. | |
setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) | |
toString | Returns a string that describes the contents of the array. (Overrides the toString Method.) | |
typeId | Returns the data type of the values in the array. | |
usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) | |
value | Gets or sets the value of the array element that is stored at the specified index. | |
wait | Pauses a process. (Inherited from Object.) | |
xml | Returns an XML string that represents the current object. (Overrides the xml Method.) | |
::create | Creates an array from the container that is obtained from a previous call to the Array.pack method. | |
::createFromXML |
Top
Remarks
Arrays can hold values of any single type, such as objects and records (contrary to the array data type that is built into the X++ language). Objects of this type can be transferred to functions and methods. The values are stored sequentially.
The arrays expand as required. Therefore, no specific dimension of the array is supplied.
Examples
The following example creates an array of classes and adds three query objects to the array.
{
Array oarray = new Array (Types::Class);
oarray.value(1, new query());
oarray.value(2, new query());
oarray.value(4, new query());
print oarray.toString();
print oarray.definitionString();
pause;
}
Inheritance Hierarchy
Object Class
Array Class