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
String Length
Moderator: Benj
-
- 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
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)
(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
― C.S. Lewis
Re: String Length
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
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
-
- 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
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.
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
― C.S. Lewis