39
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Programming Fundamentals
This chapter attempts to provide a very quick run through the fundamentals of
creating a program in Tibbo Basic. It was written under the assumption that the
reader has some experience in programming for other languages.
There is a marked resemblance between Tibbo Basic and other types of BASIC that
you may already know. Thus, we stressed the differences between Tibbo Basic and
other BASIC implementations. Some sections begin with a seemingly introductory
statement, but the material quickly escalates into more advanced explanations and
examples.
This is not a programming tutorial. We do not attempt to teach you how to
program in general. There are many excellent books which already exist on this
subject, and we did not set out to compete with any of them. This is a mere
attempt at explaining Tibbo Basic -- no more, no less.
Good luck!
Program Structure
A typical Tibbo Basic source code file (a
with the
extension) contains the following sections of code:
Include Statement(s)
These are used to
other files from the same project (such as header files
[
] containing global variable definitions or utility functions). See:
include
"global.tbh"
Global Variables Definitions
Here you define any variables you wish to be accessible throughout the current
compilation unit:
dim
foo, bar
as
integer
Subs and Functions
These are procedures which perform specific tasks, and may be called from other
places within the project.
sub
foo
...
end
sub
function
bar (a
as
integer
)
as
byte
...
end
function
Event Handlers
Tibbo Basic is
. Event handlers are platform-dependent subs, that
are executed when something happens. This 'something' depends upon your
131
15
90
15
8