General Flowcode String question

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

General Flowcode String question

Post by Dave S »

Hi all,

When a string is declared in C you add an extra byte for the "end of string" null character. For example a string to hold 1234 would be declared as STRING[5].
When using Flowcode Macro's to send or receive RS232 strings do we still allow for this null character or is it done by the Macro?
To send RS232 String 1234 do I declare STRING[4] or STRING[5]?

Thanks,

Dave

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: General Flowcode String question

Post by dazz »

HI
im a bit busy but check the flowchart at the bottom of this thread http://www.matrixmultimedia.com/mmforum ... ing#p36816

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: General Flowcode String question

Post by Dave S »

Thanks Dazz but it won't open in Flowcode 4

Dave

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: General Flowcode String question

Post by dazz »

Hi Dave
Yeah sorry about that ive attached an html page(in a zipfile) that should have the program layed out so you can see tthe macros etc

Regards
Dazz
rs232StringMacro (1).zip
(1.09 KiB) Downloaded 375 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: General Flowcode String question

Post by Dave S »

Hi Dazz,

Can't see most of that either but I think I've answered my own question now. Macro send string will send all bytes declared, ie STRING[5] with 1234 will send 1234 and whatever gibberish is in the 5th byte. From that it looks as if the NULL at the end is transparent to the user.

Thanks for your help,

Dave

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: General Flowcode String question

Post by JonnyW »

Hi Dave.

Yes, Flowcode works like C does with a null terminator but also knows how long a string is - if there is no null before the end of the string then it will not go over the end. In your example with a non-null character in the 5th byte this will be sent too, but nothing else from the end of that.

Jonny

Post Reply