r/Basic • u/CharlieJV13 • Feb 13 '23
Does anybody know of any BASIC implementation that can initialise an array like this ?
BASIC Anywhere Machine started out with an embedded copy of stock wwwBASIC.
Since December 2021, I've made so many changes to the embedded version that we might as well say that it is a fork of wwwBASIC.
Well, surprise surprise. I just discovered something that stock wwwBASIC can do:
DIM a$(5)= {"a","b","c","d", "e"}
Although I've never seen that done in any BASIC implementation until today, I'm betting this ability in wwwBASIC is inspired by the same ability in some other BASIC implementation.
Anybody have any idea?
3
Upvotes
View all comments
Show parent comment
1
u/zxdunny Feb 14 '23
It's almost Pascal-like -
Const
myarray(1..5) of string=('a','b','c','d','e');
And I'm pretty sure it's older than that too. I'm keeping away from the curly braces as Sinclair never used them for anything. I do love Pascal so it's influenced by BASIC quite a bit.