none
How to write text with a variable? RRS feed

  • Question

  • Why does Small Basic not support writing text along with a variable?  

    Example: Say "time" is a variable. Small Basic rejects TextWindow.WriteLine("You stopped at:" time). 

    Is this a bug that will be fixed in the next version?
    Sunday, November 23, 2008 11:29 PM

Answers

All replies

  • It is supported, using the '+' 

        TextWindow.WriteLine("You stopped at:" + time) 
    Sunday, November 23, 2008 11:38 PM
  • I find it funny that + was used instead of the VB & or the ancient : operators for string concatenation in BASIC. It is so C of the Small Basic developers. :)
    Monday, November 24, 2008 6:35 AM
  • Yes... but VB still allows "a"+"b" as an alternative to "a" & "b".  The former was also supported in earlier Microsoft Basics. 

    VB allows a distinction between 5+3 (which obviously gives 8) and 5 & 3 which gives "53". :)
    Wednesday, November 26, 2008 8:58 PM