Skip to content

Keywords

CrossBasic’s keywords are reserved identifiers that form the core syntax of the language. They are case‑insensitive and cannot be used as variable, function, or class names. Using these words signals to the compiler how to interpret the surrounding code.

Core Keywords

Category Keywords
Declarations Dim, Var, Const, Enum, Module, Class
Flow Control If, Then, ElseIf, Else, End If,
Select Case, Case, End Select,
For, To, Step, Next,
While, Wend, Do, Loop,
Goto, Return, Exit Sub, Exit Function
Subroutines & Functions Sub, Function, End Sub, End Function, AddressOf, AddHandler
Access Modifiers Public, Private
Extensibility Extends
Logical Operators And, Or, Not, Xor
Literals True, False

Example Usage

Module MathUtils
  Public Const PI As Double = 3.14159

  Public Function Add(a As Integer, b As Integer) As Integer
    Return a + b
  End Function
End Module

Sub Main()
  Dim result As Integer = Add(5, 7)
  If result > 10 Then
    Print("Sum is greater than 10")
  Else
    Print("Sum is 10 or less")
  End If
End Sub