Array of bytes

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
ylanchec
Posts: 54
Joined: Mon Jan 14, 2013 10:14 pm
Has thanked: 2 times
Been thanked: 2 times
Contact:

Array of bytes

Post by ylanchec »

Hi,

What is the good method to handle a array of bytes (and NULL inside) ?

Than you

Yannick

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Array of bytes

Post by DavidA »

Hi Yannick,

Can you give us a little bit more information on what advice you would like?

Do you want to iterate through each element in an array via a function or just want to know how to create an array within Flowcode?

ylanchec
Posts: 54
Joined: Mon Jan 14, 2013 10:14 pm
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Array of bytes

Post by ylanchec »

Hi,

I have two things to do :

1 - Read few bytes in a memory, and return them into an array. If the memory does not contains 0x00, it works. I want to do a function who read N bytes at one address and return these bytes in an array.
2 - I also need to send commands on bus, and the command can contains 0x00...

Thank you

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:

Re: Array of bytes

Post by Benj »

Hello,

Please can you post what you have so far and we will see if we can suggest ways to work around the problem for you.

Strings cannot have nulls as they have a special meaning but byte arrays should be ok.

ylanchec
Posts: 54
Joined: Mon Jan 14, 2013 10:14 pm
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Array of bytes

Post by ylanchec »

Hi Benj,

Ok for strings, but how to declare a byte Array ?

How to pass or get an array to a function ?

(how to post a file here ?)

Thank you

Yannick

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:

Re: Array of bytes

Post by Benj »

Hello Yannick,
(how to post a file here ?)
Under the edit post section is a upload attachment tab, this can be used to upload files.
How to pass or get an array to a function ?
I think this was added for Flowcode 6 so you cannot do it using Flowcode 5 so we will need to find you a different workaround probably using strings but not the string functions such as length.

ylanchec
Posts: 54
Joined: Mon Jan 14, 2013 10:14 pm
Has thanked: 2 times
Been thanked: 2 times
Contact:

Re: Array of bytes

Post by ylanchec »

Thank you Benj.

So with fc5, i must use a global array i think.

I declare a STRING var "mystring[10]" and i use "mystring[0 to 9]".

I have not fc6 at work, we will wait for fc7, do you have a date for it ?

Now i know how to post files... i was looking at top ...

Best regards

Yannick

User avatar
Dan81
Valued Contributor
Valued Contributor
Posts: 268
Joined: Sun Jan 15, 2006 4:07 pm
Location: Albi France
Been thanked: 60 times
Contact:

Re: Array of bytes

Post by Dan81 »

Bonjour Yannick

Ne déclare pas ta variable comme une chaine ("String") mais comme un octet (Byte) avec comme nom : myARRAY[10] par exemple.

Daniel

Post Reply