Questions tagged [basic]

BASIC: a high-level programming language favored in retro systems. For dialect-specific questions, use a tag such as [microsoft-basic], [applesoft-basic], etc.

Use this tag for questions about the BASIC programming language.

Questions with this tag should be about the language in general. Dialect-specific questions should use the dialect-specific tags, e.g. , , and .

174 questions
49
votes
3 answers

Strange math syntax in old basic listing

I'm browsing through an old book "Basic Computer Simulation" from 1983. It contains a line of BASIC code that reads: LET Z1 = M * D1 * (PQ / A) [ 3 I understand all of the code except the "[ 3" I don't ever remember that syntax in any BASIC I…
Ron Jensen
  • 593
  • 4
  • 7
34
votes
6 answers

What type of interpreter were most 8-bit BASIC implementations?

I’m a big fan of early/mid 1980s personal computers like the Amstrad CPC, Commodore 64 and the Sinclair Spectrum. One thing these computers all had was a version of BASIC. Well known ones being MS-BASIC, Locomotive BASIC, etc. As a language hacker…
Garry Pettet
  • 451
  • 4
  • 7
33
votes
2 answers

Which BASIC-like language has "ENDIF", "DIM ... OF" to declare arrays, and a double slash for comments?

My mom found some old source code that she wrote for a course around the year 1983. I've tried to identify the language that is used, but have come up empty-handed. It seemed to be BASIC at first, but I haven't been able to find a version of BASIC…
tacecapS
  • 433
  • 2
  • 5
25
votes
6 answers

Why did Visual Basic use parentheses for both function call and array access?

In VB both array access and function calls are done with () which makes it difficult to differentiate between those with a quick look. It also makes more nested levels of parentheses like MyArray(GetIndex()) which is much more readable when written…
phuclv
  • 3,592
  • 1
  • 19
  • 30
16
votes
8 answers

GOTO (etc) to a non-existent line?

Writing a BASIC interpreter has revealed a number of interesting bits of information that tend not to be mentioned in the documentation. For instance: 10 PRINT"ONE";:IF 1=2 THEN PRINT"TWO":PRINT"THREE" Will print ONE on Microsoft-derived BASICs,…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
15
votes
1 answer

Which BASICs used a backslash, \, as a statement separator?

Most dialects of BASIC allow multiple statements on a line, typically separated by colons. However, I've come across two programs that use '\' as the separator instead. One is Chase, and the version in question is for the Honeywell 600 (although the…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
14
votes
4 answers

Sources for some old BASIC games

Poking about in early issues of Dr Dobbs' Journal (the journal of the People's Computer Company, or PCC) I came across a listing for BASIC games available on tape. Many of these are widespread, but a number I have not heard of and Google is not…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
13
votes
4 answers

Could you create a loop in direct-mode with BASIC?

Were there any home computers before 1985, on which you could create a loop (finite or infinite) in direct-mode? And if it was possible on some machines, what may it have been useful for? For example, some sort of program loader from tape or…
mnml
  • 450
  • 3
  • 6
12
votes
1 answer

Which version of BASIC uses RANDOM for seeding the random number generator (RNG)?

Which version of BASIC uses RANDOM as the pseudo-random seed command? I believe that the following is correct, given the linked-to articles: Atari BASIC uses RANDOMIZE C64 BASIC uses RND(-) ZX BASIC has RAND as the keyboard token, but the…
Greenonline
  • 4,296
  • 2
  • 19
  • 57
11
votes
1 answer

Any way to simulate HP TS BASIC as seen on the 2000?

An interesting question has come up about how HP Time-Share BASIC handles this code: 10 PRINT "HOW MANY STARS DO YOU WANT"; 20 INPUT N 30 FOR J = 1 TO N 40 PRINT "* "; 50 NEXT J 60 END ANSI/ECMA will print no asterisks if you enter zero at the…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
11
votes
8 answers

Variances in Basic highest line numbers

I used to wonder why different versions of Basic on 8bit machines would impose different limits on the highest line number permitted. I should point out this excludes any trickery to manually change a line number to an otherwise inaccepted value (…
AndyF
  • 584
  • 5
  • 13
10
votes
1 answer

Any historical references to links between JOSS and BASIC?

I only recently learned of the JOSS language, and then only through a roundabout fashion from an interview with David Ahl where he mentions FOCAL. This led me to read the available manuals for all versions of these languages. And that leads to a…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
9
votes
4 answers

Did any 8-bit versions of MS BASIC allow user-defined string functions?

My BASIC is almost working, the almost being the DEF FN. Just so I don't paint myself into a corner, is there any "mainstream" BASIC from the 8-bit era that allowed user-defined string functions? I'm mainly using "The Basic Language" from BASIC…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
9
votes
1 answer

String libraries for BASIC

Looking over old BASICs I find two general approaches to handling string variables. HP/Wang/Atari/et al used C-like array-of-char whose memory size is specified with a DIM statement, with the upside of no heap management and the downside of always…
Maury Markowitz
  • 19,803
  • 1
  • 47
  • 138
7
votes
3 answers

Storing results in BASIC DATA statements

Back when I first started in the industry, my first job was processing royalty for an oil and gas company. They used TRS-80 model 1 computers using a BASIC interpreter. The programs were on floppy disks. They contained the owner information in DATA…
Tom Magaro
  • 71
  • 3
1
2