77
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
implement a cycle!
The same result could be achieved in a different manner:
<!DOCTYPE HTML
public
"-//W3C//DTD W3 HTML//EN">
<HTML>
<BODY>
BEGINNING OF OUTPUT<br>
<?
dim
i
as
integer
dim
s
as
string
s="<i> Foo </i> <br>"
for
i = 1
to
10
while
sock.txfree<len(s)
'these free lines can be omitted for simple
doevents
'tests but are actually essential for
wend
'reliable output of large data chunks
sock.setdata(s)
'this prepares data for output
sock.send
'and this commits it for sending (see sock
object)
next
i
?>
<br>
end
OF OUTPUT<br>
</BODY>
</HTML>
Here we have a single code block and "printing" the same line several times is
achieved by using
and
object.
So, which of the two examples shows a better way of coding? Actually, both ways
are correct and equally efficient. The first way will have an advantage in case you
have large static blocks that may be harder to deal with when you need to print
them using sock.setdata method.
Further information about creating HTML files with dynamic content can be found
in
object documentation).
Understanding Platforms
As an embedded language, Tibbo Basic may find itself within many various
hardware devices; each such device may have different capabilities in terms of
storage, physical interfaces, processing power, and other such parameters.
Thus, Tibbo Basic is not a one-size-fits-all affair; it is customized specifically for
every type of physical device on which TiOS runs. A function which initializes a
WiFi interface would make very little sense on a device which does not support
WiFi. The same would go for a function which clears the screen -- what if you have
no screen? This holds true even for string functions -- some platforms are so tiny,
they do not even need to support string processing!
Because of this, the 'core' of the Tibbo Basic language is actually very minimalistic
-- we call it "pure" -- it contains only the statements listed under
below. Any other functionality is implemented specifically for each platform, and is
documented in detail for your platform under
.
353
353
274
314
274
79
133