' CARDATA.BAS
' This program uses the PRINT# statement to send three lines of
'   car information to a sequential file.

OPEN "CARDATA.TXT" FOR OUTPUT AS #1  ' open file in current drive/dir

CLS

' get some car information from the user and write it to the open file

INPUT "Enter the make of a car in your collection:  ", makeName$
INPUT "What is the model name?  ", modelName$
INPUT "What year was the car made?  ", year%

PRINT #1, makeName$, modelName$, year%

' add some literal values to the file

PRINT #1, "Mercedes-Benz", "190 SL", 1959

' add a new car to the file (RIGHT$ function returns current year
'   from DATE$ function)

PRINT #1, "Audi", "80 Quattro", " "; RIGHT$(DATE$, 4)

CLOSE #1                             ' close the file

PRINT
PRINT "Information has been successfully written to CARDATA.TXT"

