Gentee Programming Language > Documentation > Libraries Download documentation

variant.arrcreate

This method creates the SafeArray array in the variable of the VARIANT type. VARIANT is an element of the array. Values can be assigned to the array elements using the arrfromg method. An element of the array can be obtained with the help of the arrgetptr method.
 
uint variant.arrcreate(
      collection   bounds
)

Parameters

boundsThe collection that contains array parameters. Two numbers are specified for each array dimension: the first number - an element quantity, the second number - a sequence number of the first element in the dimension.

Return value

If error occurs, method returns zero, otherwise returns 1.

The example uses SafeArray

   VARIANT v 
   v.arrcreate( %{3,0,2,0} )//An array with 3 lines and 2 columns is being created  
    
   v.arrfromg( %{0,0, 0.1234f} )    
   v.arrfromg( %{0,1, int(100)} )   
   v.arrfromg( %{2,1, "Test" } )
   ...
   excapp~Range( excapp~Cells( 1, 1 ), excapp~Cells( 3, 2 ) ) = v //The array is being transmitted to the COM object   

SafeArray allows you to group data, that makes data exchange with the COM object faster.

See also

    Working with COM Object


 Copyright © 2004-2006 Gentee Inc. All rights reserved.