Skip to main content

Basics about syntax and variables

There are a few rules of thumb in the BBj language that you might find useful in the beginning:

  • No or squiggles or similar - BBj is structured by its keywords (CLASS - CLASSEND, METHOD - METHODEND etc)
  • No semicolons at the end of lines
  • BBj is a dynamic language. Variables can be used without formal declaration, but you can declare variables that are Object-Types
  • BBj knows a few "built-in" Variables: Numbers, Whole Numbers and Strings. Plus Objects.
  • Comments are in lines that start with REM (for "Remark")
  • Variable names and keywords are Case-Insensitive
  • But references to (Java) Classes retain their case-sensitivity

Watch this video about Variables in BBj:

Watch on YouTube

BBx Clues 3: Variables: https://www.youtube.com/watch?v=DRjpwGLKzQA

BBj Variables Cheat Sheet​

Generic Variable Types​

Strings end with "$":

MyString$ = "Hello World"

Numbers have no Suffix:

SomeNumber = 3.14

Whole Numbers = Integers end with "%":

SomeIntegerNumber% = 3

Object Types​

Object Types end with "!":

myMap! = new java.util.HashMap()
api! = BBjAPI()

Declare Object Types with "declare"

declare java.util.HashMap myMap!
myMap! = new java.util.HashMap()

Import Java Types with "use"

use java.util.HashMap
declare HashMap myMap!
myMap! = new HashMap()