readdata.bas
来自「82 sample programs written in BASCOM-805」· BAS 代码 · 共 49 行
BAS
49 行
'-------------------------------------------------------------
' READDATA.BAS
' Copyright 1997-2000 MCS Electronics
'-------------------------------------------------------------
Dim A As Integer , B1 As Byte , Count As Byte , Sgl As Single
Dim S As String * 15 'XRAM only !!!
Dim L As Long
Restore Dta1 'point to stored data
For Count = 1 To 3 'for number of data items
Read B1 : Print Count ; " " ; B1
Next
Restore Dta2 'point to stored data
For Count = 1 To 2 'for number of data items
Read A : Print Count ; " " ; A
Next
Restore Dta3 'strings can be used only with XRAM
Read S : Print S
Read S : Print S
Restore Dta4
Read L : Print L 'long type
Restore Dta5
Read Sgl : Print Sgl
End
Dta1:
Data &B10 , &HFF , 10
Dta2:
Data 1000% , -1%
Dta3:
Data "Hello" , "World"
'Note that integer values (>255 or <0) must end with the %-sign
'also note that the data type must match the variable type that is
'used for the READ statement
Dta4:
Data 123456789&
'Note that LONG values must end with the &-sign
'Also note that the data type must match the variable type that is used
'for the READ statement
Dta5:
Data 100.1!
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?