String Concatenation

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

String Concatenation

Post by Alan_37 »

Hi

Hi after 2 days trying to debug and see what is wrong , I found that this is a bug in Flowcode

So Here it is, having the following Variables : String_1[100] , Result_string[100]

If i put the following in a loop it will work perfectly until the Result_string is 100 characters long so that is fine :
Result_string = Result_string + String_1

But if I put the following in a loop the result string STOPS Concatenating when it reaches 21 characters long :
Result_string = Result_string + String_1 + ">"


It is not Possible to detect this in simulation it only happens when the program is downloaded to the MCU ( Arduino Mega 2560 )
Attachments
Concat.png
(22.62 KiB) Downloaded 4421 times
Concatination_Test.fcm
(1.91 KiB) Downloaded 137 times

kersing
Valued Contributor
Valued Contributor
Posts: 1940
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: String Concatenation

Post by kersing »

Flowcode has a known limitation where it misbehaves when concatenating multiple (>2) strings. Limit the concatenation to two strings and you are fine.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: String Concatenation

Post by Alan_37 »

Hi kersing Thanks for your reply .

OK good to know of this known limitation for such a Basic Function in V7 .

So ok splitting the concatenation in 2 parts should solve my problem.

Thanks .

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: String Concatenation

Post by Alan_37 »

Yes i can confirm that by splitting the concatenation in 2 parts will do it .

Result_string = Result_string + String_1
Result_string = Result_string + ">"

Just another small thing , is there a POST or a page on the wiki with a list of these known limitations ?
cause that would have saved a lot of time .

kersing
Valued Contributor
Valued Contributor
Posts: 1940
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Contact:

Re: String Concatenation

Post by kersing »

I have added a note to the wiki page on string operations.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply