Saturday, April 16, 2016

ARRAYS :Array oarray = new Array (Types::Class)

ARRAYS 


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.

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;

EXIST METHOD
array a = new array(types::Integer); 
 
    a.value(1, 23); 
  
    print a.value(1); 
    pause; 
    if (a.exists(7)) // No, only element 1 is initialized 
    { 
        print a.value(7); 
  
    } 

Reference: https://msdn.microsoft.com/

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...