{{htmlmetatags>metatag-robots=()
metatag-title=(READ | ugBASIC User Manual)
metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum)
metatag-description=(Manual page for READ)
metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png)
metatag-og:title=(READ | ugBASIC User Manual)
metatag-og:description=(Manual page for READ)
}}
====== ugBASIC User Manual ======
===== READ ✓ =====
===== SYNTAX =====
READ var
==== PURPOSE ====
The ''READ'' is used for reading constant values from ''DATA'' lines into the
given variables. This command is able to read more constants at once with a
variable list separated by commas.
If using the wrong type of variable (for example read a character string into a
numerical variable like float or integer), the variable will be untouched.
Such behavior can be prevented by generally using a variable of the same type
like the ''DATA AS'' used.
With a value that falls outside the expected range of a ''READ'' variable,
e.g. the value is outside the range of an integer, ugBASIC will implicitly
convert it, with a precision lost, but only if ''SAFE'' keyword is used.
If more constants are read than values
exist in ''DATA'' lines, garbare will be read. It can be avoided by using
''SAFE'' keyword or using ''READ END'' function. Using ''SAFE'' the
variable will not be touched if last value is already read.
A succeeding ''READ'' searches for the first ''DATA'' statement where the
''DATA'' read pointer is adjusted to.
==== EXAMPLE ====
READ nextStep
See also the following example files:
* ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/data_example_01.bas|data_example_01.bas]]''
* ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/data_example_02.bas|data_example_02.bas]]''
* ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/data_example_03.bas|data_example_03.bas]]''
==== ABBREVIATION ====
R#
==== AVAILABLE ON ====
*
* Atari (400/800)
* Atari XL/XE
* Commodore 128 (MOS 8502)
* Commodore 128 (Zilog Z80)
* Commodore 64
* Commodore 64+REU
* TRS-80 Color Computer
* TRS-80 Color Computer 3
* ColecoVision
* Amstrad CPC 664
* Dragon 32
* Dragon 64
* Thomson MO5
* Thomson MO5
* Olivetti Prodest PC128
* Commodore PLUS/4
* SEGA SC-3000
* SEGA SG-1000
*
* VG-5000
* Commodore VIC-20
* ZX Spectrum 48
==== ANY PROBLEM? ====
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON READ|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY =====
[[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]