String Length

Please add any feature requests for Flowcode version 7 here

Moderator: Benj

Post Reply
Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

String Length

Post by Docara »

Hi

Would it be possible to have the option to automatically reserve the precise string length?

At the moment FC defaults to 20 locations why not just analyse the length and reserve accordingly.

Matt

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: String Length

Post by kersing »

How would Flowcode know what length you need? You might append to strings, get data from external sources etc. If you know the size you can specify the required size yourself: String name[size]
(Being a C programmer I still declare string sizes one element larger than the number of characters for the terminating zero)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

Re: String Length

Post by Docara »

Hi Kesing,

Like I said an option to have it. To give this some context I am working on displaying scrolling message text on an LCD display, some of which needs to be joined together. It would have been nice to use the length$() command and then be able to amend the reserved buffer space if need be other than arbitrarily reserve a chunk arbitrarily

Matt

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: String Length

Post by kersing »

Matt,

All memory allocations are done at compile time, so the is no way to change them at runtime. And if you know the required size you can set it yourself in stead of the arbitrary size.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply