303 READ To enable numbers or words that are required in a program to be made available every time the program is run. It does this by reading numbers or words into numeric or string variables from DATA statements in the program. Most often the data is read into an array. See the keyword DIM for more information on arrays. See the keyword DATA for a more detailed description. Purpose Example 100 READ name$(X),A Description A statement which copies the next item from a data list into the variable or variables which follow the keyword READ . The DATA must contain the correct sequence of string and numeric data for the string and numeric variables to be assigned.
In other words numeric data must be supplied if a numeric variable is to be filled. Syntax READ | {, | } Associated keywords DATA , RESTORE Demonstration Program 200 INPUT"How much can you spend",AFFORD 210 PRINT"You can afford the following cars" 220 FOR X=1 TO 10:READ NAME$,PRICE 230 IF PRICE 240 NEXT:END 500 REM British Leyland Cars 510 DATA AUSTIN METRO 1.0 HLE, 4699 520 DATA etc etc