READ

READ V

ASSIGNS TO THE VARIABLE V THE VALUE FOUND IN A "DATA" STATEMENT

  • Type: Command
  • Parameters: n
  • Group: Reference

ACTION

The command READ stores in the variable V the value found in a DATA line. Each time one value is read, the next item in the statement DATA is ready for the next command READ.

SYNTAX: READ V

  • V = variable name (simple or array)

USE

  • The command READ is used to assign to a variable the value found inside the program source.

ERROR

  • If no value is available in the DATA statements (all the DATA have been read)
  • If there is no DATA statement

EXAMPLE

dim a,b,c,d$

data 1,2,3,"Hello"

read a:print a

read b:read c:print b:print c

read d$:print d$

SEE ALSO

DATA

RESTORE