[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

EXAMPLES of PRINT# Statement:
 1)

   10 OPEN 1,1,1,"TAPE FILE"
   20 R$=CHR$(13)                      (By Changing the CHR$(13) to
   30 PRINT#1,1;R$;2;R$;3;R$;4;R$;5     CHR$(44) you put a "," between
   40 PRINT#1,6                         each variable. CHR$(59) would
   50 PRINT# 1,7                        put a ";" between each variable.)


 2)

   10 CO$=CHR$(44):CR$=CHR$(13)
   20 PRINT#1,"AAA"CO$"BBB",           AAA,BBB     CCCDDDEEE
      "CCC";"DDD";"EEE"CR$             (carriage return)
      "FFF"CR$;                        FFF(carriage return)
   30 INPUT#1,A$,BCDE$,F$

 3)

    5 CR$=CHR$(13)
   10 PRINT#2,"AAA";CR$;"BBB"          (10 blanks) AAA
   20 PRINT#2,"CCC";                   BBB
                                       (10 blanks)CCC
   30 INPUT#2,A$,B$,DUMMY$,C$

READ

TYPE: Statement
FORMAT: READ <variable>[,<variable>]...

Action: The READ statement is used to fill variable names from constants in DATA statements. The data actually read must agree with the variable types specified or the BASIC error message ?SYNTAX ERROR will result.* Variables in the DATA input-list must be separated by commas.

A single READ statement can access one or more DATA statements, which will be accessed in order (see DATA), or several READ statements can access the same DATA statement. If more READ statements are executed than the number of elements in DATA statements(s) in the program, the


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated November 14, 1998.