Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
crackerjack Senior Member Joined: 11/07/2011 Location: AustraliaPosts: 164
Posted: 12:51am 15 Oct 2011
Copy link to clipboard
Print this post
I'm unsure if this has been noticed or mentioned before, but it seems that MMBasic doesn't require end quotes on strings. This is odd, but advantageous if you want to save a byte here and there and a keystroke or two. Newline seems to suffice to terminate the string. Try these:
[code]
load "myprog.bas
...or...
A$ = "test
? A$
[/code]Edited by crackerjack 2011-10-16
Greg Fordyce Senior Member Joined: 16/09/2011 Location: United KingdomPosts: 153
Posted: 09:07am 15 Oct 2011
Copy link to clipboard
Print this post
I have noticed this as well, but it will only save you a few keystrokes. MMBasic will add the end quotes to a program listing. Try this,
> 10 print "Hello
> list
10 PRINT "Hello"
aargee Senior Member Joined: 21/08/2008 Location: AustraliaPosts: 255
Posted: 11:00am 15 Oct 2011
Copy link to clipboard
Print this post
That was actually part of many of the original Basic implementations. I clearly remember programming this way in the early '80s and I've never used an end quote with the MM.Edited by aargee 2011-10-16For crying out loud, all I wanted to do was flash this blasted LED.
crackerjack Senior Member Joined: 11/07/2011 Location: AustraliaPosts: 164
Posted: 12:18am 16 Oct 2011
Copy link to clipboard
Print this post
Just look out for strange and odd behaviour if you have multi-line statements such as:
[code]
10 A$ = "Foo : B$ = "Bar
[/code]
A$ will have a value of Foo : B$ = and B$ will be uninitialised and empty. MMBasic will not add end-quotes.