MultilineString

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
SparrowhawkMMU
Posts: 281
Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom

MultilineString

Post by SparrowhawkMMU »

Hi Fred,

I was looking at the Dialog library and it struck me that it would much easier to add long XML if SpiderBasic supported something like >>heredoc strings<< or >>template literals<<

So for example, the example from the help file could (optionally) be rewritten from:

Code: Select all

XML$ = "<window id='#PB_Any' name='test' text='Dialog example' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
         "  <panel>" +
         "    <tab text='First tab'>" +
         "      <vbox expand='item:2'>" +
         "        <hbox>" +
         "          <button text='button 1'/>" +
         "          <checkbox text='checkbox 1'/>" +
         "          <button text='button 2'/>" +
         "        </hbox>" +
         "        <editor text='content' height='150'/>" +
         "      </vbox>" +
         "    </tab>" +
         "    <tab text='Second tab'>" +
         "    </tab>" +
         "  </panel>" +
         "</window>"
To something like:

Code: Select all

MultilineString XML$
    <window id="#PB_Any" name="test" text="Dialog example" minwidth="auto" minheight="auto" flags="#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget">
          <panel>
            <tab text="First tab">
              <vbox expand="item:2">
                <hbox>
                  <button text="button 1"/>
                  <checkbox text="checkbox 1"/>
                  <button text="button 2"/>
                </hbox>
                <editor text="content" height="150"/>
              </vbox>
            </tab>
            <tab text="Second tab">
            </tab>
          </panel>
        </window>
EndMultilineString
Which would make editing of long strings much, much easier :)

What do you think?
User avatar
SinisterSoft
Posts: 77
Joined: Sun Apr 06, 2014 11:41 pm
Location: Preston, UK
Contact:

Re: MultilineString

Post by SinisterSoft »

+1

Would be good in PureBasic too.
Post Reply