BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→Altair BASIC and Micro-Soft)
(→CHR$ and the Dollar Sign in BASIC (Sidebar))
Line 55:Line 55:
== CHR$ and the Dollar Sign in BASIC (Sidebar) ==
== CHR$ and the Dollar Sign in BASIC (Sidebar) ==
−
In designing BASIC, Kemeny and Kurtz needed to distinguish variables that hold numeric values from those that hold strings of text. They chose to have string variables and string functions end with a "$," so that a string variable might be named A$ and the function that produced one-character strings based on ASCII values was called CHR$. They selected the dollar sign because there "were not so many keys on a Teletype, and we needed to find one that had not yet been used for BASIC. Of the few remaining ones, none seemed very appropriate. Then one of us observed that $ looks like S for string" (Kemeny & Kurtz 28).
+
In designing BASIC, Kemeny and Kurtz wanted to distinguish between variables that held numeric values and variables that held strings of text. They chose to have string variables and string functions end with a "$," so that a string variable might be named A$ and the function that produced one-character strings based on ASCII values was called CHR$. They selected the dollar sign because there "were not so many keys on a Teletype, and we needed to find one that had not yet been used for BASIC. Of the few remaining ones, none seemed very appropriate. Then one of us observed that $ looks like S for string" (Kemeny & Kurtz 28).
Computers are fundamentally machines that add and multiply, so it is a curious circumstance that the Commodore 64 keyboard, like modern North American keyboards, has a dollar sign on it but does not have a multiplication sign. Instead, the asterisk (*), the typographical mark once used to indicate a footnote, is pressed into service as the symbol for multiplication.
Computers are fundamentally machines that add and multiply, so it is a curious circumstance that the Commodore 64 keyboard, like modern North American keyboards, has a dollar sign on it but does not have a multiplication sign. Instead, the asterisk (*), the typographical mark once used to indicate a footnote, is pressed into service as the symbol for multiplication.

Revision as of 13:12, 15 July 2011

View this revision of BASIC.

Personal tools