Page 1 of 1

Arrays in flowcode for AVR ver 4

Posted: Fri May 07, 2010 3:39 pm
by riveva
What's going wrong. I try to use 2-dimensional arrays in flowcode with C-blocks . I think that the syntax is right.

In C-block I wrote:
"
unsigned char FCV_LABY [7][10]={
{0x01,0x02,0x0B,0x09,0x03,0x0A,0x09,0x03,0x0B,0x08},
{0x06,0x09,0x05,0x06,0x0D,0x03,0x0C,0x05,0x06,0x09},
{0x01,0x05,0x06,0x09,0x04,0x06,0x09,0x06,0x09,0x05},
{0x05,0x06,0x09,0x06,0x09,0x01,0x09,0x06,0x09,0x05},
{0x05,0x06,0x09,0x06,0x09,0x01,0x06,0x09,0x05,0x05},
{0x07,0x0E,0x0B,0x0B,0x0C,0x05,0x03,0x0A,0x0C,0x05},
{0x04,0x02,0x0C,0x04,0x02,0x0E,0x0E,0x0A,0x08,0x0F}
};

"


and later I'll try to read this array in C-block
"
FCV_APU1=FCV_LABY[FCV_RIVI,FCV_SARAKE];

"
apu1, rivi and sarake are global variables..
but it doesn't work ....

What's wrong???

Re: Arrays in flowcode for AVR ver 4

Posted: Fri May 07, 2010 4:37 pm
by Sean
Hello,

The array initialization syntax is correct.

The command to read back an array element has the two index values in a single set of brackets separated by a comma. These values should be in separate square brackets:

FCV_APU1=FCV_LABY[FCV_RIVI][FCV_SARAKE];

Re: Arrays in flowcode for AVR ver 4

Posted: Fri May 07, 2010 5:16 pm
by riveva
It seems to work, I have to correct my errors. Thank You very much...........