Page 1 of 1

Array of bytes

Posted: Mon Feb 01, 2016 10:38 am
by ylanchec
Hi,

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

Than you

Yannick

Re: Array of bytes

Posted: Mon Feb 01, 2016 12:21 pm
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?

Re: Array of bytes

Posted: Mon Feb 01, 2016 2:20 pm
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

Re: Array of bytes

Posted: Mon Feb 01, 2016 3:30 pm
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.

Re: Array of bytes

Posted: Mon Feb 01, 2016 3:57 pm
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

Re: Array of bytes

Posted: Mon Feb 01, 2016 4:12 pm
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.

Re: Array of bytes

Posted: Mon Feb 01, 2016 4:19 pm
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

Re: Array of bytes

Posted: Sun Feb 14, 2016 11:15 am
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