Display string issue

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Display string issue

Post by medelec35 »

The attached flowchart should take an integer value of 267 and display 26.7
Flowchart.png
(8.39 KiB) Downloaded 1406 times
Flowcode simulator shows:
LCD1.png
(2.91 KiB) Downloaded 1406 times
Hardware is the same as real pic which shows:
LCD2.png
(1.34 KiB) Downloaded 1406 times
Not sure why only the last byte of the string is displayed.
I'm hoping to save some memory and use:

Code: Select all

Temp_String = Left$ (Temp_String,2) + "." + Right$ (Temp_String,1)
Martin
Attachments
Dispaly String issue.fcfx
(6.9 KiB) Downloaded 182 times
Martin

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Display string issue

Post by LeighM »

Hi Martin,
Thanks for the detailed bug report.
We do have some known problems with the generated target code for string concatenation (mainly due to memory constraints on target and the use of temporary buffers)
I’ll try and raise the priority of this issue.
In the meantime, the workaround is to avoid multiple concatenations on the same line

Code: Select all

Temperature = Left$ (Temp_String,2) 
Temperature = Temperature + "." 
Temperature = Temperature + Right$ (Temp_String,1)
I think your other example

Code: Select all

Temp_String = Left$ (Temp_String,2) + "." + Right$ (Temp_String,1)
would be even more tricky, as it would require more internal buffers, but I’ll add this issue to the bug log as an interesting challenge :D
Regards,
Leigh

Post Reply