Multi

From Catglobe Wiki
Jump to: navigation, search



Multi

An identifier with array type is created for each Multi question, its value is an array of boolean values, whose size (number of items) is equal to the maximum answer option value defined in the question.

A value of answer option value decreased by 1 can be used as index of the array, the value returned indicates if the corresponding answer option has been selected, true for selected and vice versa.

Example

5703.jpg

number n = arrayCount(RA);//4

if (RA[0])//Reklame

//do something

else if (RA[2] //Marketing

//do something else

A multi question can be compared (equality) to a range or a number.

Example

if (RA == [1-3]) //If Reklame or Markedsanalyse or Marketing has been selected

//do something

Answer option can be set selected by assigning values to the question identifier.

Example

RA = AnotherMulti; //copy the values of AnotherMulti to RA

RA = empty; //de-select all answer options

array a = {true, false, false, false};

RA = a; //set only Reklame to selected

RA[3] = true; //set Journalistik to selected