1 out of 9 rated this helpful - Rate this topic

Array Class [AX 2012]

The Array class is an array abstract data type that holds values of any single type, stored sequentially.

class Array extends Object

Run On

Called
  MethodDescription
Gg802677.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif definitionString Returns a string that contains the definition of the array.
Gg802677.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif exists Indicates whether a particular array element is valid.
Gg802677.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif lastIndex Retrieves the highest index that is used to store a value in the array.
Gg802677.pubmethod(en-us,AX.60).gif new Creates an array where each element has the type that is specified by the argument. (Overrides the new Method.)
Gg802677.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif pack Serializes the current instance of the Array class.
Gg802677.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif toString Returns a string that describes the contents of the array. (Overrides the toString Method.)
Gg802677.pubmethod(en-us,AX.60).gif typeId Returns the data type of the values in the array.
Gg802677.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif value Gets or sets the value of the array element that is stored at the specified index.
Gg802677.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg802677.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Overrides the xml Method.)
Gg802677.pubmethod(en-us,AX.60).gif Gg802677.static(en-us,AX.60).gif ::create Creates an array from the container that is obtained from a prior call to the Array.pack method.
Gg802677.pubmethod(en-us,AX.60).gif Gg802677.static(en-us,AX.60).gif ::createFromXML
Top

Objects of this the Array class may be transferred to functions and methods.

The Array class can hold objects and records, unlike the array data type that is built into the X++ language.

Arrays of the Array class can expand as needed so that no specific dimension of the array must be supplied.

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; 
} 
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.