New answers tagged

4

The answer by @Raffzahn is close, but it has at least one important detail wrong: the total length of the token names has nothing to do with it. The following facts all all relate to the issue. Commodore Basic (any Microsoft Basic really) stores programs in a tokenized form in memory. That means here that all Basic keywords are replaced by a single byte, ...


2

MS-BASIC is for many parts modelled after DEC's PDP-11 BASIC. And PDP-11 BASIC is as well quite related to ECMA-55 Minimal BASIC, so as usual when talking about old BASIC details a look at the fine crafted ECMA-55 specification is helpful. For PRINTing of number is notes: Numeric-expressions shall be evaluated to produce a string of characters ...


2

When I did my MS basic clone I found I needed the trailing space on numbers and a leading space if the number wasn't negative. Looking at the tests I wrote STR$ always puts a leading space in. I think I ended up testing with a UK101,Pet,Apple and CP/M version of MS basic in the end.


2

Not all MS BASICs include spaces. AppleSoft — which is derived from MS BASIC — would output A5B if it saw PRINT "A";5;"B"


0

INPUT with comma vs. semi I'm not sure what this is supposed to ask, but ... According to the GW-BASIC documentation, a semicolon between the INPUT prompt and the variable suppresses the question-mark prompt. I do not believe this was the case on the Apple or PET/C64, It was on the Apple and all other MS-BASIC versions, but not on the PET. ...


4

The comma syntax does not work in Commodore BASIC, neither on the PET (Commodore BASIC V4.0), nor on C64 (Commodore BASIC V2.0), C16/116 (Commodore BASIC V3.5) or Commodore 128 (Commodore BASIC V7.0). Using a construction like INPUT "ENTER SOMETHING",A$ yields a SYNTAX ERROR. There are however other ways to suppress the question mark prompt on a C64, see the ...


2

To further confuse the issue, both ANSI/ECMA BASIC standards, in their minimal and full implementations, do not allow simple scalars an arrays to have the same name. This from ECMA-55: Minimal BASIC, page 9: The same letter shall not be the name of both a simple variable and an array, nor the name of both a one-dimensional and a two- dimensional ...


2

I propose that Dartmouth's implementation of BASIC should be regarded as definitive, since they invented the language. In Dartmouth BASIC, A and A() were distinct variables. The single letter denoting a list or table name may also be used to denote a simple variable without confusion. (In this context, "list" is a 1-dimensional array, "table" is a 2-...


4

It depends on your BASIC. Some Basic distinguish between arrays and simple variables, some don't. MS-BASIC, Sinclair's ZX81 and many other separate them. Similar for simple variables, some BASIC distinguish between simple varables of different type. So A, A$, A! and A% are different variables. The workings come from the way variables are searched. The ...


15

They're two different variables, at least in the version of MS BASIC on the C64: DIM A(4) READY. PRINT A, A(1) 0 0 READY. A = 1 READY. PRINT A, A(1) 1 0 Basically A and A(...) refer to two different variables, just like A$ and A% are also different variables than A.


Top 50 recent answers are included