none
BUG! Publish removes spaces included between a pair of quotes! RRS feed

  • Question

  • I used the Publish option for the first time today and was surprised to discover that the program eliminates any repeating spaces  between 2 quote marks.

    This screwed up the logic of my program BIG TIME!

    1) Any headings I want printed are messed up.

    Ex: GraphicsWindow.DrawText(x,y,"Head1      Head2")

    gets listed by Publish as .......(x,y,"Head1 Head2")

    2) You can't use the time-tested code to right justify text. i.e. Pad the front of your variable with a string of blanks & retrieve the right n characters where n = the desired field width. Imagine what happens when I try to take the right 8 characters of a 6 character field!

    Why would any program remove "excess" spaces included between a pair of quote marks?!!?

    Friday, May 18, 2012 11:04 PM

Answers

  • It's not really a "bug", it's just that your browser automatically strips away excess spaces when it displays HTML.

    If you import the program back into Small Basic the spaces will be intact.

    If you look at the web page HTML the spaces are still intact:

    <span class='StringLiteral'>"Head1      Head2"</span>

    I suppose they could modify the code that generates the web page to insert the &nbsp; character entity instead of space characters to make the listing look visually similar to how it looks in the Small Basic code editor..

    Saturday, May 19, 2012 12:53 AM