ArraySwapElements

Swaps elements in an array.

Syntax:

ArraySwapElements( array, subA1, subA2, subA3, subA4, subA5, subB1, subB2, subB3, subB4, subB5 )

Parameters:

(a) array: specifies an array.

(i) SubA1: subscript (dimension 1) of element 'A' or zero.

(i) SubA2: subscript (dimension 2) of element 'A' or zero.

(i) SubA3: subscript (dimension 3) of element 'A' or zero.

(i) SubA4: subscript (dimension 4) of element 'A' or zero.

(i) SubA5: subscript (dimension 5) of element 'A' or zero.

(i) SubB1: subscript (dimension 1) of element 'B' or zero.

(i) SubB2: subscript (dimension 2) of element 'B' or zero.

(i) SubB3: subscript (dimension 3) of element 'B' or zero.

(i) SubB4: subscript (dimension 4) of element 'B' or zero.

(i) SubB5: subscript (dimension 5) of element 'B' or zero.

Returns:

(i)  returns 1.

 

This function swaps the values of two elements in an array.

"subA1" to "subA5" specify the subscripts of element "A"

 "subB1" to "subB5" specify the subscripts of element "B"

Specify "0" for unused dimensions.  For example, to identify the array element "arr[1,5]", subA1 is 1 and subA2 is 5.

 

Example:
myarray=ArrDimension(2)
myarray[0] = 1
myarray[1] = 2
ArraySwapElements( myarray, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 )
Message( "ArraySwapElements", "myarray[0] = " : myarray[0] : @CRLF : "myarray[1] = " : myarray[1])
See Also:

Arrays, ArrayFileGet, ArrayFileGetCsv, ArrayFilePut, ArrayFilePutCsv, ArrayFromStr, ArrayInsert, Arrayize, ArrayItemize, ArrayLocate, ArrayRedim, ArrayRemove, ArrayReverse, ArraySort, ArraySwapElements, ArrayToStr, ArrDimension, ArrInfo, ArrInitalize, Drop