Skip to content

Latest commit

 

History

History
43 lines (39 loc) · 5.13 KB

numeric-variables.md

File metadata and controls

43 lines (39 loc) · 5.13 KB

Documentation

Numeric variables

BIPLAN supports only one signed numeric variable type, that is by default long (if a different type is required see configuration). Numeric variables are identified by @. The name of variables must not contain numbers, must be composed by lowercase and or uppercase letters and or the symbol _. Each variable is just an entry of a global array of variables. BIPLAN supports up to 88 variables.

See below how to define a variable:

@test = 10

Variables can be accessed by name:

print @test // Prints "10"

All Variables can be accessed by reference using @[]:

@test = 111
print @[0]  // Prints 111 or the value of the first variable defined
@[0] = 2
print @test // Prints 2

The reference of a variable can be obtained prepending its name with index:

@a_variable = 10 // index 0
@variable = 1    // index 1
@var = 22        // index 2

print index @var // Prints 2 or the index of $var

The bcc compiler starts from the longest variable name, for this reason @var is the last to be compiled and acquires the reference 2.