Data Sheet

dScript
dScript User Manual v2.15
Variables
The are two variable types, integer variables and string variables. Variable names must start
with a letter and may be followed by letters ( A-Z, a-z ), digits ( 0-9 ) or an underscore ( _ ).
No other characters are permitted in variable names. All variables are global and may be
accessed from any subroutines or threads.
Integer variables
There are three types of integer variables used to store numbers.
var X1
int32 X2
int16 X3
int8 X4
Variable types var and int32 are identical, they are just two names for the same thing. These
integer variable types are stored as 32 bit signed numbers. The range of values that can be
stored is from -2147483648 to 2147483647.
Variables of type int16 hold 16 bit signed numbers. The range of values that can be stored is
from -32768 to 32767.
Variables of type int8 hold 8 bit signed numbers. The range of values that can be stored is
from -128 to 127.
It is recommended that 8 and 16 bit variables are used only when you absolutely must. This is
likely to be when locating variables in eeprom memory which is limited. For general use there
is no point in trying to save memory if your application is only going to be using part of it.
Internally dScript uses 32 bit numbers for all calculations anyway, so always try to use var
types, or int32 if you prefer.
You can have any number of integer variables up to the limit of the on-board RAM memory.
Variables can be named as you choose. Short names like x and y are fine, but there are no
built in limits to the length of the name, so be descriptive in your choices. Variable names are
case sensitive so:
var mycounter
var myCounter
are two different variables.
Variable names are not loaded into the module. All variables are compiled to an index code, so
long variable names neither consume valuable memory space on the module or slow down
program execution.
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
11