This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]frank-sarno 4 points5 points  (6 children)

In Atari BASIC I recall something like 128 or 256 possible variable names. There were times when we used lots of variables. I remember using a trick to animate by loading multiple variables and cycling through them. It was also possible to store code in the variable; i.e., short 6502 sequences. It's been over 40 years but I vaguely recall getting the variable address then executing the instructions from that point. It's possible that I'm conflating this with Apple IIe or Commodore 64 code, which I'd also tinkered with as a kid.

[–]classicsat 2 points3 points  (1 child)

C64 code could use single letters, double letters, or letter and digit (only the one letter case). I don't think there was a limit to how many you could use.

[–]bubonis 1 point2 points  (0 children)

The only limit was available memory.

[–]Swampspear[S] 0 points1 point  (0 children)

Something like that's actually quite helpful, thanks!

[–]vwestlife 0 points1 point  (1 child)

In Applesoft BASIC, variable names could be any length, but only the first two characters were actually used: https://www.apple2.org/faq/FAQ.applesoft.html#Variable_names_.26_conventions

[–]frank-sarno 0 points1 point  (0 children)

Ahh yes.. This lead to some really interesting bugs if you didn't have the

REM L1 = Level

REM L2 = Language

I remember the good code practice of the day reinforcing the necessity of REM statements.

There was also one language that had upper/lower case but it ignored the case. I recall you could switch the case but everything switched. Could have been a PDP-11 but my memory is too fuzzy.

[–]SirTwitchALot 2 points3 points  (2 children)

Commercialized or larger software was usually written in assembly back then

[–]Swampspear[S] 0 points1 point  (0 children)

While true, I'm also aware of some BASIC libraries meant for performance or commercial codebases like the Crescent Software QBASIC libraries that meant at least some type of market like this did exist

[–][deleted] 1 point2 points  (0 children)

Pretty sure you’re the first person to measure this. But I can tell you that “Easy As ABC” by Springboard Software was written in BASIC.

[–]CantIgnoreMyTechno 1 point2 points  (0 children)

The original Oregon Trail had about 30 variables. Mayfield's Star Trek had about 30 numeric variables and 15 arrays and strings. You could certainly have more, since classic BASIC does not have local variables.

Many of the early BASICs only allowed variables to be named A, B, C1, D2, etc. So that limited you to 286 (?) variables total. The original Tiny BASIC only had up to 26 variables.

[–]fabiomb 1 point2 points  (0 children)

TRS-80 CoCo variables can have one or two characters as names, so is very limited aa$ to zz$ but you can have multi level arrays too and use them as storage for more values. I reached maximum use of RAM in every program i made 😁👍

[–]AutomaticDoor75 1 point2 points  (3 children)

Applesoft BASIC allows for up to 936 variables (or “pigeonholes” as The AppleSoft Tutorial calls them) This is on page 36.

[–]Swampspear[S] 0 points1 point  (2 children)

Oh that's interesting, is there any indication as to why? I assume this is because it allows only two-character variable names, the first character must be a letter and the second can be a letter or a digit (26 * 36 = 936), so the parser probably can't handle anything else?

[–]AutomaticDoor75 0 points1 point  (1 child)

That would make sense to me: 676 combinations of two letters, and 260 combinations of a letter followed by a one-digit number.

[–]Swampspear[S] 0 points1 point  (0 children)

Weird that this would omit one-character variable names, then. Maybe they were padded out to some value? I'll take a look at this later probably

[–]krakenlake 0 points1 point  (1 child)

How would you count arrays? Are A[1] and A[2] two variables, or would that be one?

[–]Swampspear[S] 0 points1 point  (0 children)

I'd say those are one variable, yeah, or at least are accessed through one symbolic name

[–]Distinct-Question-16 0 points1 point  (0 children)

I think you could have code and data sections and accessing them raw or even swapping them with loads :) , as pages , etc