42
Programming with TIDE
©2000-2008 Tibbo Technology Inc.
Note that a this isn't the same character as an apostrophe. An
apostrophe is ' and a single quote-mark is a `. Usually, the single
quote mark is found on the tilde (~) key, and the apostrophe is found
on the double-quote (") key.
How to Define Constants In Different Bases
Tibbo Basic allows you to assign values to constants using decimal, hexadecimal or
binary notation. Decimal notation is the default. To assign a hexadecimal value,
you must use the prefix &h before the first hexadecimal digit of your value. To
assign a binary value, you must use the prefix &b in the same manner. So:
q =
15
' this is 15, in decimal.
q =
&hF
' this is still 15, just in hex.
q =
&b1111
' and this is also 15, just in binary notation.
These prefixes hold true whenever values are used -- there are no exceptions to
this rule. Whenever a numeric value is used, it may be preceded by one of these
prefixes and will be interpreted correctly.
How to Use Colons
Colons are actually not necessary in most parts of Tibbo Basic. They are a
traditional part of many BASIC implementations, and are often used to group
several statements in one line. However, since Tibbo Basic doesn't really care
about spaces anyway, they lose their relevance.
No Tibbo Basic statements require the use of colons.
Naming Conventions
Identifiers
An identifier is the 'name' of a constant, a procedure or a variable. It is case
insensitive. It may include letters (A-Z, a-z), digits (0-9) and the following special
characters: . ~ $ !. It must start with a letter, and cannot contain spaces.
For example:
dim a123 as integer ' A legal example
dim 123a as integer ' An illegal example
dim a.something as integer ' Can contain dots.
sub my_sub (ARG1 as integer, ARG2 as string) ' This is also legal
Platform Objects, their Properties and Methods
The name of an object is used as a prefix, followed by a dot, followed by the name
of the property or the method you would like to access. For example:
ser.send ' Addressing the 'send' method of a 'ser' object.
x = ser.baudrate ' Assigning variable X with the value of the 'baudrate'
of a 'ser' object