This is an old revision of the document!
|ENTER “H1:PROGRAM.BAS”||Load a BASIC program|
|LIST “H1:PROGRAM.BAS”||Save a BASIC program|
|NEW||Clear the computer's memory by erasing any old instructions|
|DOS||Switch to DOS|
|PRINT FRE(0)||Check how much memory is available|
|BYE||Activate Self Test|
|PRINT#6;“HELLO”||Display characters in the graphics window of in a split-screen mode|
Examples of using PRINT:
PRINT "TEXT", TEXT followed by a tab PRINT "TEXT";"ABC" Concatenated strings: TEXTABC PRINT "TEXT":PRINT "ABC" Two instructions in the same line PRINT New line
The Atari disk input/output commands:
|num|| A reference number between 1 and 7 that is used to refer to the file throughout a program.
The reference number is also called IOCB number (Input/Output Control Block).
|code|| An open code is a number that tells the computer if you want to read, write:
4 - read
8 - write; first erase the file and start writing at the beginning
12 - read/write
9 append; add to end of file
|file||A file specification composed of the device and filename.|
DIM F$(20) F$="H1:TEST.DAT" OPEN #1,8,0,F$ Open a file TEST.DAT for writing PRINT #1;"HELLO!" Write a string to the file PRINT #1; 123.4 Write a number (as a string) to the file PRINT #1;"THERE IS MORE:"; 987 Write a string and a number (as a string) to the file CLOSE #1 Flush the buffer and close the file OPEN #2,4,0,F$ Open a file TEST.DAT for writing REM Note that we could use #1 again as the file has been closed DIM D$(30):REM Allocate memory for a string we want to read from the file INPUT #2,D$ Read the string to the variable D$ PRINT D$:REM Prints HELLO! INPUT #2,D$:REM Read the next string (which is a number stored as a string) PRINT D$:REM Prints 123.4
More on using disks with Atari BASIC can be found here.