Reply To: arrays in Multi-Edit

Product Compare Forums Multi-Edit Support arrays in Multi-Edit Reply To: arrays in Multi-Edit

#4297
deleyd
Participant

Those are all good questions. Hopefully the new CMAC manual will cover this more indepth.

The example code given in HELP about arrays and structures actually generates an error when the index jx=100, because arrays start at zero:[code:1bku5yiz]struct ts
{
int tarray[100];
}

void test_array
{
struct ts m;
int jx;

for(jx=0;jx<=100;jx++)
{
m.tarray[jx] = jx; // Attempting to write to an array
// that is out of bounds will
// generate a run-time error
}
make_message( str(m.tarray[22]) );
}[/code:1bku5yiz]
in CMAC arrays can only be created inside a structure.
Above, m is the structure, tarray[100] is the array inside the structure. The array goes from tarray[0]tarray[99]. To reference an array element you have to specify the structure (m) and the array within the structure

m.tarray[0]
m.tarray[1]
m.tarray[2]


m.tarray[99]

CMAC does not support “an array of strings”. (Note above it’s an array of integers).