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>"
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
What do you think?