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
General Flowcode String question
Moderator: Benj
Re: General Flowcode String question
HI
im a bit busy but check the flowchart at the bottom of this thread http://www.matrixmultimedia.com/mmforum ... ing#p36816
Regards
Dazz
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
Re: General Flowcode String question
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
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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
Re: General Flowcode String question
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
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
- 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
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
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