Basic30 Language Reference
Dim Statement |
Define variables.
| [ { Public | Private |
External }] Dim name [, name2 ...] As
type [ = expression ] |
- name
- Required name for this variable.
- , name2 ...
- Optional list of variables to define.
- type
- Required data type for the variable or variables.
- expression
- Optional initial value for the variable or variables.
- Public
- Optional keyword to define this variable as a public member when
compiling to a library file. If omitted, private access is used.
- Private
- Optional keyword to define this variable as a private member when
compiling to a library file. If omitted, private access is used.
- External
- Optional keyword to mark this variable as being defined in an external
file which will be linked to the project after compiling. If omitted,
private access is used.
Examples
Sub main()
init()
TurnOnLED(3)
End Sub
Sub init()
' initialization code goes here
End Sub
Sub TurnOnLED(led as uByte)
' Code to turn on the requested LED
End Sub
Also See:
Variable Types