Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dartmouth BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Fourth Edition=== The Third Edition remained in use through the GE-235's lifetime into the fall of 1967. However, as plans were made to receive the GE-635, an experimental version was created on the 635 in the spring of 1967. This version was a partnership between GE and Dartmouth, with GE contributing a new operating system as well as a number of features of BASIC from their own Mark 1 BASIC efforts.{{sfn|Kurtz|1981|p=528}} This version, initially published as a supplement to the Third Edition, added the <code>RANDOMIZE</code> command to "seed" the <code>RND</code> function, and the <code>ON...GOTO</code> "computed goto" that closely matched the similar feature in FORTRAN. This version also allowed <code>ON...THEN</code>, arguing that <code>IF...THEN</code> did not require the <code>GOTO</code> then it would not be required here. The new <code>TAB</code> function moved printing to a given column, from 0 to 74.{{sfn|Kurtz|1981|p=528}} Another internal change was to once again change the <code>MAT</code> to be 1-based; one could use the 0th index, but it would normally be ignored by the various commands.{{sfn|Kurtz|1981|p=529}} The major addition for this version was string variables, along with changes to the <code>READ/DATA</code> statements which could store strings in them and the <code>INPUT</code> statement to read them interactively. One feature of the string system was that trailing spaces were deliberately ignored in comparisons, so that "YES" and "YES " were considered equal.{{sfn|Man4|p=66}} This was later realized to be a grave error.{{sfn|Kurtz|1981|p=529}} String variables were indicated by the dollar sign, e.g. {{code|A$}}, simply because they were running out of characters that could be found on most keyboards. Someone pointed out that the $ looked like the S in "String", and that was that.{{sfn|Kemeny|Kurtz|1985|p=28}} String manipulation was handled through the new {{code|CHANGE}} command. This converted the string value in a variable to the equivalent set of ASCII values. The numeric array could then be manipulated and converted back to a string. For instance, this code produces "is" on the console: {{sxhl|2=basic|1= 100 LET S$ ="Now is the time" 110 CHANGE S$ TO S 120 LET T(1) = S(5) 130 LET T(2) = S(6) 140 LET T(0) = 2 150 CHANGE T TO T$ 160 PRINT T$ }} Line 140 sets the string length to 2, which has to be managed by the user. The first character is in T(1). While this system is flexible, it was by no means convenient to use. Later versions would address this with new functionality.{{sfn|Kemeny|Kurtz|1985|p=29}} Minor changes in this version changed the semicolon in <code>PRINT</code> statements to do "close packing" of output with no spaces,{{sfn|Kemeny|Kurtz|1985|p=24}}{{sfn|Man4|p=64}} and the use of the apostrophe as a short-form <code>REM</code>.{{sfn|Man4|p=52}}{{efn|It is not clear if the apostrophe was used in previous versions, the Revision 4 manual is the first to mention it explicitly.}} The official Fourth Edition did not appear until 1968, which added several new features on top of the previous additions. This included the ability to define multi-line functions with the <code>DEF</code> command, and the powerful <code>CHANGE</code> statement that treated strings as arrays of [[ASCII]]-like codes so individual characters could be operated on without looping over the entire string.{{sfn|Kurtz|1981|p=529}} This was also the only string manipulation function; to extract a single character or substring, one had to use <code>CHANGE</code> to convert it into an array of numbers, manipulate that array, and then convert it back. This was the reason MAT was 1-based again; the length of the string was placed in location zero, and it needed to be ignored normally.{{sfn|Man4|p=67}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)