# Batch Basic 2 language guide While Batch Basic should be familiar to many programmers, some aspects of the language don't work in the usual way. ## Strings, PRINT and special characters In Batch Basic, strings can't be stored in variables or otherwise manipulated, but only printed out. In other words, you can't do this: let greet$ = "Hello, world!" print greet$ but you can do this: print "Hello, world!" To output special characters, there's a special construct: print "Hello, world"; chr$(33) Note, that's not a function, and in fact you can also write it like this: print "Hello, world" chr$ 33 Indeed, Batch Basic is lenient about commas and the like, in many places. ## DATA and company Batch Basic has DATA, READ and RESTORE statements, but they don't work quite like in other dialects. For one thing, DATA is an executable statement, so it has to run before any values are made available to the program. On the plus side, DATA takes expressions, not just literals, and you can call it in a loop. Due to the absence of line numbers or labels, RESTORE takes an index number instead, starting at zero, which is also the default. Internally, the values defined with DATA are stored in a vector, that can be accessed with PEEK and POKE. In interactive mode, this vector is cleared on NEW or LOAD. ## Arrays As of version 2.4 beta, Batch Basic has arrays, but they can only have one dimension. They also use square brackets, and are zero-indexed: dim test[10] let test[0] = 5 print test[0] redim test[20] let test[10] = 15 You can name an array the same as a scalar variable, but beware that ERASE will remove both of them. In Batch Basic, REDIM always preserves array contents.