Variables 

BlitzScript3D is virtually typeless. Variables can be assigned strings, integers, or floats without any datatype indicator.

For example:

a="Hello World"

b=1

c=234.5

A Integer value will be treated like string until a math operation is performed with it. When a math operation is performed, its treated like a float. So, if you need to evaluate a integer after a math operation has been performed, include a decimal point (ie: 12.0).

BlitzScriptVar

BlitzScript3D also features a special global array 'BlitzScriptVar' that can be assigned values and accessible in both script and application using the following commands:

BlitzScriptVarSet(index,value)
BlitzScriptVarGet(index)

Examples

blitzscriptvarset(1,"Hello World")

blitzscriptvarset(25,450.0)

print(blitzscriptvarget(2))

BlitzScriptVar provides a simple mechanism to share data between the script and application directly. The current maximum number of BlitzScript Variables is 32, however, this value can be increased in the scripting engine source bscvmVar.bb.

Lock and Unlock

Variables are used to store handles for a SubScripts and Labels. These values are sensitive and can result in script failure if accidently overwritten. To prevent accidental overwrite, BlitzScript3D offers a means to protect the values stored in variables using Lock and Unlock Keywords.

Example

a=a+1
b=b+1
if b=100.0 then
a="Locked!"
lock a
endif
if b=500.0 then
unlock a
a="Unlocked!"
endif
print(a)

Lock/Unlock Keywords can be applied to any Variable.

Variable Scope

Variables are automatically scoped as 'public', or 'private' dependent on where they are declared. Public Variables are declared outside a function and can be used from anywhere in the program. Private Variables can only be used within the function they are created in. Functions are not implemented at this time.