Equinox Online Help - Language Reference - A to Z

Home

Vector

Applies to
SyntaxVector (VectorExpression [, StartExpression, LengthExpression])
Action[Function] Returns part of an array dimension.
ScopeUsable anywhere
Notes

This function may also be used to assign values to part of a dimension in a similar way to the string functions Mid, Left and Right. The parameter VectorExpression contains the reference to the part of the array you wish to assign values to; it must evaluate to a single dimension array. StartExpression and LengthExpression specify the first element and number of elements in the dimension. StartExpression defaults to 1 and LengthExpression defaults to the rest of the dimension

CategoryArrays
See Also ArrayGetDimensions, ArraySetDimensions, ArraySort, VectorSize
Example

This example assigns the value of -1 to the 5 elements starting from position 2 in the third row of the array.

Vector(s[3], 2, 5) = -1

This example shows more advanced uses of the function.

int t[2][3][4]
string s[10]

| type conversion
s = 1,2,3,4,5,8,12,16,20,55

| set 24 elements to -4
t = -4

| automatic error handling - different sizes
Vector(t[1][2],2,3) = Vector(t[1][3],1,1)

| and different types, optional parameters
Vector(t[1][3],2) = s
t[2][3] *= 2

| and finally
Vector(Vector(t[2][2],1,3),2,1) = 42

| can you work it out ?
print t,;;