📄 declare.bas
字号:
'----------------------------------------------------
' (c) 1997-2000 MCS Electronics
' DECLARE.BAS
'----------------------------------------------------
Declare Sub Test(a As Byte , B1 As Byte) 'declare the subs
Declare Sub Test2
Declare Sub Test3(bl As Bit)
Declare Sub Test4(x As Xram Byte)
Dim A As Byte , B1 As Byte , Bl As Bit 'dim used variables
Dim X As Xram Byte , Xa(10) As Xram Byte
B1 = 3
Call Test2 'call sub
Test2
Call Test(1 , B1) 'call sub with parameters
Print B1
Call Test3(p1.1)
Xa(1) = 1
Call Test4 Xa(1) 'call with array variable without call statement
End
'End your code with the subprograms
'Note that the same variables must be used as the declared ones
'Also note that variables are global
Sub Test(a As Byte , B1 As Byte) 'start sub
Print A ; " " ; B1 'print passed variables
B1 = 3
End Sub
Sub Test2 'sub without parameters
Print "No parameters"
End Sub
Sub Test3(bl As Bit) 'bit as parameter
Print Bl
End Sub
Sub Test4(x As Xram Byte)
Print X
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -