Flowcode Arrays

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Flowcode Arrays

Post by Gnu »

Can you please tell me the maximum number of elements I can use in an integer array. Are 2-dimensional arrays permitted ?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Gnu

Two dimensional arrays are not permitted in Flowcode but you can implement them via the C code flowchart icons.

The maximum size of an array is 64 bytes. This represents an entire page in memory. This means that for an integer array the maximum you can have is 32 elements.

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Post by Gnu »

Thanks Benj.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

It may be more that 64 bytes. This is from the BoostC manual:
Arrays can have any number of dimensions. The only constraint is that an array must fit into a single RAM bank.
So in reality it depends on the chip and what other variables you are using (18F devices have up to 256 bytes available in each RAM bank, so the theoretical maximum is 256 array elements).[/code]

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Flowcode Arrays

Post by Gnu »

Thanks for this supplementary information, Steve. I am using a 16F88 at the moment, but this isn't set in stone. Ideally I need to store 75 integers in the array; however, I can probably get round the problem by using more than one array.

Gnu.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Hi Gnu,

Even with the 16F88, you should be able to have an array of up to 96 elements.

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Flowcode Arrays

Post by Gnu »

Thanks Steve. I'll try it out.

Gnu

Gnu
Posts: 20
Joined: Mon Apr 16, 2007 6:59 pm
Location: UK
Contact:

Flowcode Arrays

Post by Gnu »

Sorry to keep plaguing you! However, I have just tried a few simulations, and the Flowcode V3 progam crashes if the array declaration is greater than [35].

Gnu

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Gnu

If you are creating an integer array then each integer location will take up two bytes. This means that an int array declared as 35 will actually have 70 byte locations. You should be able to create your program using two arrays. Then you can do a decision eg depending on a index variable to choose which array your looking at.

Post Reply