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
Atari 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!
===Program editing=== [[Image:AtariBasicError.png|frame|Syntax errors are reported immediately after a line is entered.]] Atari BASIC is anchored around its [[line editor]]. Program lines can be up to three physical screen lines of 40 characters, 120 characters total. The cursor can be moved freely, with the editor automatically tracking which BASIC program line the current screen line is part of. For instance, if the cursor is currently positioned in line 30 and the user uses cursor-up into line 20, any editing from that point will be carried out on line 20. Atari BASIC's editor catches many errors are ignored in Microsoft-derived versions. If an error is found, the editor re-displays the line, highlighting the text near the error in [[inverse video]]. Errors are displayed as numeric codes, with the descriptions printed in the manual.{{sfn|Manual|1980|loc=Appendix B}} Because of the way the line editor works, the user can immediately fix the error. In the example pictured above (with <code>PRUNT</code>), the error can be fixed by moving the cursor over the <code>U</code>, typing {{keypress|I}} (the editor only has an overwrite mode), and hitting {{keypress|RETURN}}. A line entered with a leading number, from 0 to 32767,{{sfn|Crawford|1982|p=10.3}} is inserted in the current program or replaces an existing line. If there's no line number, the interpreter assigns it the number -1 ($8000) and the commands are executed immediately, in "immediate mode". The <code>RUN</code> command executes the stored program from the lowest line number. Atari BASIC allows all commands to be executed in both modes. For example, <code>LIST</code> can be used inside a program, whereas in many interpreters this would be available in immediate mode only. During entry, keywords can be abbreviated using the pattern set by [[Palo Alto Tiny BASIC]], by typing a period at any point in the word. So <code>L.</code> is expanded to <code>LIST</code>, as is <code>LI.</code>. Only enough letters have to be typed to make the abbreviation unique, so <code>PLOT</code> requires <code>PL.</code> because the single letter P is not unique. To expand an abbreviation, the tokenizer searches through its list of reserved words to find the first that matches the portion supplied. More commonly used commands occur first in the list of reserved words, with <code>REM</code> at the beginning (it can be typed as <code>.</code>). When the program is later <code>LIST</code>ed it will always write out the full words with three exceptions: <code>PRINT</code> has a synonym, <code>?</code>; <code>GOTO</code> has a synonym, <code>GO TO</code>; and <code>LET</code> has a synonym which is the empty string (so <syntaxhighlight lang="basic" inline>10 LET A = 10</syntaxhighlight> and <syntaxhighlight lang="basic" inline>10 A = 10</syntaxhighlight> mean the same thing). These are separate tokens, and so will remain as such in the program listing. MS BASICs also allowed <code>?</code> as a short-form for <code>PRINT</code>, but this used the same token so it expanded back to {{code|PRINT}} when {{code|LIST}}ed, treating it as an abbreviation, not a synonym.
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)