Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
NewArray = SRP_Rotate_Array(Array, MajorDelim, MinorDelim)

Returns

The rotated array.

Parameters

ParameterDescription
ArrayThe dynamic array to be rotated. Required.
MajorDelimThe delimiter that separates rows if Array is in LIST format or columns if it is in ARRAY format. Optional. If you omit this parameter, @FM will be assumed.
MinorDelimThe delimiter that separates elements in within each column (ARRAY format) or row (LIST format). Optional. If you omit this parameter, @VM will be assumed.

Remarks

Two dimensional dynamic arrays can be in one of two formats: LIST format or ARRAY format. The names for these formats derive from the LIST and ARRAY properties of the OpenInsight Edit Table. Both formats represent columns and rows but are delimited differently. In the LIST format, the dynamic array is first broken into rows by the major delimiter (@FM), and each element is broken into columns using the minor delimiter (@VM).

...

To use it, simply pass the array you wish to rotate. If your array uses the @FM and @VM delimiters, then there is nothing else you need to do. If, however, your array uses alternative delimiters, just supply them via the MajorDelim and MinorDelim parameters. Notice that you don't need to specify the format. SRP_Rotate_Array determines the format of the given array and simply returns the array in the other format. With a single, fast call you can convert LISTs into ARRAYs and ARRAYs into LISTs.

Examples

Code Block
* To show equivalency, convert an ARRAY to a LIST in an OI EditTable
Array = Get_Property(@Window:".EDT_TEST", "ARRAY")
List = SRP_Rotate_Array(Array)
Set_Property(@Window:".EDT_TEST", "LIST", List)

* Rotate a list into an array using custom delimiters
List = "Don,Bakke*Paul,Simonsen*Frank,Tomeo*Bob,Fernandes*Kevin,Fournier"
Array = SRP_Rotate_Array(List, "*", ",")
//Array will be: "Don,Paul,Frank,Bob,Kevin*Bakke,Simonsen,Tomeo,Fernandes,Fournier"