SecondBASIC Documentation v3

Home / Command Reference / Read, ReadInt, ReadLong


Description: Reads data from Data, DataInt, and DataLong statements.


Read <Variable> [, <Variable> [, n]]
ReadInt <Variable> [, <Variable> [, n]]
ReadLong <Variable> [, <Variable> [, n]]

Part Description
<Variable> Required. Reads the data into the variable. If <Variable> is an integer, the data will be read and the most significant byte will be set to 0. If <Variable> is a string, then the data will be copied into a string one byte after another until a null (0) is reached.

Note: Only integers can be used with ReadInt and only longs can be used with ReadLong.


        Reload MyData
        For i = 0 To 1
                Read b$
                Print b$
        Reload MyDataInt
        For i = 0 To 3
                ReadInt a
                Print a
        Reload MyDataLong
        For i = 0 To 2
                ReadLong b&
                Print b&()
        Data "Hello World!", "More Data"
        DataInt 0,1,$0EAA, &hFF
        DataLong 80000,95000,8975200