Page 1 of 2
Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 3:12 pm
by willzz32
Hi All
Got a question regarding the preset string. (flowstone 3.02)
I am using the edit box in multi line mode and sending this across to the preset string. All works well and as expected the string shows multi line output when hooked up to a text box. When i save the string via the preset text file all the data is also saved correctly, The problem is when loading the data back in via the preset text file and manager the preset string only shows the first line of the data.
Is this a know issue or am i missing something obvious regarding this. I could use string arrays which work properly but this means i have to save a text file for each array.
Any help would be much welcomed.
Cheers
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 3:21 pm
by tester
It's not issue. Single-line string and multi-line text - both share the same connectors, and this causes such things. If you have multi-line text - you need convert it into single-line string (max 255 chars per "preset string" prim) using unique separator (like comma), which you use then to split the string into multi-line text again after reload.
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 3:32 pm
by willzz32
Hi tester
Thanks for the fast reply and your help.
Do i need to separate it within the edit box as i type or can this be done after the edit box .Such as adding a comma each time a new line is entered or reached.
I'm making a small note pad that can follow cues so as to make notes during shows.
Cheers
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 5:40 pm
by tester
Check here:
viewtopic.php?f=2&t=1441&start=10#p7221No need for separator in editbox; conversion is detected/done per line.
Generally you need select a separator (comma or else), that will be not used in editbox. In above link you find an example how to convert array to such string back and forth. In between - you just place the "preset string" prim.
But keep in mind, that this way - single "preset string" prim can handle a string only 255 chars long, including separators.
Hope this helps a little bit.
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 5:46 pm
by willzz32
Hi tester
Thanks for the help and pointing me in the right direction. Very Much appreciated.
Cheers
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 6:02 pm
by Nubeat7
the same in ruby would look like this, maybe all the ruby regex would be of interest for following cues
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 7:35 pm
by willzz32
Hi Nubeat7
Thanks so much for that , I have been scratching my head trying to get a grip of it even going trough the post tester pointed me to.I work a lot in midi in FS so this is a problem i have not had to get my head around before.
From what you have posted looks like i can now split the edit box multi ,save it as a single string and reload and resplit it.
Thanks for your help!!!!!
Re: Edit Box(multiline) and preset string
Posted: Sun Aug 11, 2013 8:17 pm
by willzz32
Hi
That works really well loads and save correctly , only problem i have now is when i load all the text is in the right place apart from when i start to edit, all the text jumps on to one line but only when editing.
Any thoughts?
Re: Edit Box(multiline) and preset string
Posted: Mon Aug 12, 2013 3:36 am
by RJHollins
Nubeat7 wrote:the same in ruby would look like this, maybe all the ruby regex would be of interest for following cues
Thanks for a RUBY version, NuBeat !
Re: Edit Box(multiline) and preset string
Posted: Mon Aug 12, 2013 11:22 am
by Nubeat7
willzz32 wrote:Hi
That works really well loads and save correctly , only problem i have now is when i load all the text is in the right place apart from when i start to edit, all the text jumps on to one line but only when editing.
Any thoughts?
difficult to say without schmatic..