43
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Events
Events are related to specific objects, just like properties and methods. However,
events are named differently. The pattern is on_objectname_eventname. Such as
on_door_open.
sub on_ser_data_arrival ' event names may contain more than one word after
the object name.
Introduction to Variables, Constants and Scopes
Variables and constants are a major part of any programming language, and Tibbo
Basic is no exception; below you will find explanations on the following:
Type Conversion in Expressions
Understanding the Scope of Variables
4.2.4.1
Variables And Their Types
Variables are used to store values during the execution of an application. Each
variable has a name (the
used to refer to the value the variable
contains) and a type, which specifies how much data this variable can contain, and
also what kind of data it may contain.
Not every variable type is supported on every platform. You will find
related information in the "Supported Variable Types" topic in the
platform documentation. If you attempt to use a type which is not
supported by your platform you will most probably get "platform does
not export XXX function" error during compilation.
Variables are defined using the
prior to being used in code. The
simplest syntax for defining a variable would be something like:
dim
x
as
integer
' x is a variable of type 'integer'.
dim
str
as
string(32)
' str is a variable of type 'string' with a maximum
length of 32 characters (bytes).
A variable name must begin with a letter, and must be unique within the same
scope, which is the range from which the variable can be referenced.
43
45
48
49
50
54
55
57
60
60
132
81