The definition of an array member is the same like for an ordinary variable. The only extension is the possibility to define multiple array members in a single statement.

// a single array member can be

// fast but inflexibel

// defined like a normal variable

char* str1 = DSIN["arr[12]"];

arr[12] = "hello"

// flexibel solution

 

char* str2 = DSIN["arr"][12];

// multiple array members

 

// in a single statement

char* f1 = DSIN["field"][0];

field[] { "one"  "two"

char* f2 = DSIN["field"][1];

            "three" "four"}

char* f3 = DSINI["field"[2];

 

char* f4 = DSIN["field"][3];

 

 

Multiple member definition is only possible for the last dimension of an array:

twodim[0][] { 11 12 13 }

int i11 = DIN["twodim"][0][0];

twodim[1][] { 21 22 23 24 25 }

int i12 = DIN["twodim"][0][1];

twodim[2][] { 31 32}

int i13 = DIN["twodim"][0][2];

 

int i21 = DIN["twodim"][1][0];

 

int i22 = DIN["twodim"][1][1];

 

int i23 = DIN["twodim"][1][2];

 

int i24 = DIN["twodim"][1][3];

 

int i31 = DIN["twodim"][2][0];

 

int i32 = DIN["twodim"][2][1];

Structs may contain arrays and vice versa. They can be combined directly or via global variables.

{

int nr = DIN["pointlist"]["nr"];

   arr[]

int x1 = DIN["pointlist"]["point"][0]["x"];

   {

int y1 = DIN["pointlist"]["point"][0]["y"];

       {x = 10 y = 20}

int x2 = DIN["pointlist"]["point"][1]["x"];

       {x = 30 y = 40}

int y2 = DIN["pointlist"]["point"][1]["y"];

   }

 

}

 

 

 

testfunction

 

{

 

   pointlist

 

    {

 

       nr = 2

 

       point = (arr)

 

  }

 

}

 

The return of arrays to CxxTester is similar to the read access:

DOUT["arr"][0][0] = 100;

int arr[0][0] = 100

DOUT["arr"][0][1] = 200;

int arr[0][1] = 200

Arrays should be used in order to keep the contents of the testscripts as close as possible to the C++ signature of the targetsoftware.