VBArray object
This object provides access to arrays created by Visual Basic scripts.
Visual Basic arrays cannot be created with the VBArray object, and their contents cannot be modified.
The VBArray object can only connect to a Visual Basic array and read its contents.
Syntax:
Creating a new VBArray object:
var vbArr = new VBArray (arrayInVB)
arrayInVB | Required. Reference to a Visual Basic array. |
Members:
The VBArray object inherits from the VBArray.prototype and Function.prototype objects.
The following lists only contain the members of the VBArray and VBArray.prototype objects.
(*) - The method is inherited from the RegExp.prototype.
Properties:
Property | Support | Description | |||||
---|---|---|---|---|---|---|---|
prototype | Returns a reference to the VBArray.prototype object. The VBArray.prototype object allows adding properties and methods to the VBArray object that can be used with instances of the VBArray object, like any predefined property or method. The prototype property is static, it cannot be accessed from an instance of the VBArray object, only VBArray.prototype is allowed. |
Methods:
Method | Support | Description | |||||||
---|---|---|---|---|---|---|---|---|---|
dimensions ( )* | Returns the number of dimensions in the referenced Visual Basic array. | ||||||||
getItem (index1 [, index2, ...], indexN)* |
Returns the elements at the specified positions from the referenced Visual Basic array.
|
||||||||
lbound (dimension)* |
Returns the lowest index in the specified dimension of the referenced Visual Basic array.
|
||||||||
toArray ( )* |
Converts the referenced Visual Basic array to a standard JavaScript array.
The returned JavaScript object is always a one dimensional array regardless of the dimension count of the Visual Basic array. The method uses backward lexicographical ordering on the indexes of the Visual Basic array for the order of the items in the JavaScript array. For example if the Visual Basic array has 3 dimensions, and 0,1,2 indices in every dimension, the order of this element in the JavaScript array: (0,0,0) (1,0,0) (2,0,0) (0,1,0) (1,1,0) (2,1,0) (0,2,0) (1,2,0) (2,2,0) (0,0,1) (1,0,1) (2,0,1) (0,1,1) (1,1,1) (2,1,1) (0,2,1) (1,2,1) (2,2,1) (0,0,2) (1,0,2) (2,0,2) (0,1,2) (1,1,2) (2,1,2) (0,2,2) (1,2,2) (2,2,2) |
||||||||
ubound (dimension)* |
Returns the highest index in the specified dimension of the referenced Visual Basic array.
|
(*) - The method is inherited from the RegExp.prototype.
Examples:
Example 1:
This example shows how you can create an array in Visual Basic script and how you can handle this array from JavaScript.
|
External links:
User Contributed Comments
http://dumpsite.com/forum/index.php?topic=63.0