DATATYP
The DATATYP function returns a number that represents the data type of
the next value to be read from a DATA statement (see Table 5-3).
Table 5-3. Numbers Representing Input Data Types
--------------------------------------------------------------------------------------------
| | |
| DATATYP | Type of Next Item in |
| Result | DATA Statement |
| | |
--------------------------------------------------------------------------------------------
| | |
| 1 | DECIMAL |
| | |
--------------------------------------------------------------------------------------------
| | |
| 2 | Entire string |
| | |
--------------------------------------------------------------------------------------------
| | |
| 4 | End-of-record (EOR) mark |
| | |
--------------------------------------------------------------------------------------------
| | |
| 5 | SHORT INTEGER |
| | |
--------------------------------------------------------------------------------------------
| | |
| 11 | INTEGER |
| | |
--------------------------------------------------------------------------------------------
| | |
| 13 | REAL |
| | |
--------------------------------------------------------------------------------------------
Syntax
DATATYP
Examples
10 READ A,B$
20 PRINT DATATYP
30 DATA 1.0,"hello",3
Line 20 above will print 5. Since the first two items have been read,
the value 3 is the next item in the DATA statement.