GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | READ

Edit History

READ

READ var1 [, var2, …, varN]

Home > Reference > Data

Assigns values in DATA items to the specified variables var1 to varN. Unless a RESTORE command is executed, SmallBASIC moves to the next DATA item with each READ assignment. If SmallBASIC runs out of DATA items to read, an run-time error occurs.

See DATA and RESTORE for more information.

Example 1: READ with one variable

FOR c = 1 TO 6
   READ x
   PRINT x
NEXT

DATA "a,b,c", 2
DATA 3, 4
DATA "fifth", 6

Example 2: READ with two variables

FOR c = 1 TO 3
   READ x, y
   PRINT x, y
NEXT

DATA "a,b,c", 2
DATA 3, 4
DATA "fifth", 6
Code samples using READ
001 3 ways to print hello 5 times.bas   003 conditional branching.bas   004 loops.bas   006 arrays+.bas   3d wire cube v1.bas   3d wire cube.bas   3dtictac.bas   3dttt.bas   3dttt.bas   7gables.bas   anomail.bas   Balleta 2-11-15.bas   BAS_1968.bas   BAS_NOW.bas   betrayal: crows ii.bas   blackbox.bas   Blackbox.bas   bolmo.bas   Calendar.bas   calendar.bas   conrec-sb-v01.bas   crow.bas   cube3d.bas   dataminmax.bas   dogstar5.bas   Eliza.bas   eliza.bas   evdemo.bas   falling blocks - tetris.bas  
Data
APPEND   ARRAY   DATA   DELETE   DIM   EMPTY   ERASE   INSERT   ISARRAY   ISDIR   ISFILE   ISLINK   ISMAP   ISNUMBER   ISSTRING   LBOUND   LEN   READ   REDIM   RESTORE   SEARCH   SORT   SWAP   UBOUND  
This page was last edited on Tue, 4 Jul 2023 17:42:18 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.