88
Language Reference
©2000-2008 Tibbo Technology Inc.
Details
Functions cannot be nested (which is why their scope is defined as global or
HTML). Function always return a single value. Functions can call other functions
and subroutines.
The return value of a function must be explicitly set from within the body of the
function, by referring to the name of the function as a variable (of type ret_type)
which is then assigned a value.
Examples
'this is just an example to show how functions call each other. It's not
actually useful.
declare
subtract (x
as
byte
, y
as
byte
)
as
integer
' have to declare,
because it's invoked before its body.
function
distance(x
as
byte
, y
as
byte
)
as
integer
if
x>y
then
distance = subtract(x,y)
else
distance = subtract(y,x)
end
if
end
function
...
function
subtract (x
as
byte
, y
as
byte
)
as
integer
subtract = x - y
end
function
Goto Statement
Function:
Jumps to a specific point in code, marked by a label.
Syntax:
goto label
...
label:
Scope:
Local and HTML
See Also:
---
Part
Description
label
Required. Marks a specific point in code.
Details
Unconditionally jumps to label in code. Notice that all goto labels are local -- you
cannot use goto statement to jump from within one procedure into another
procedure!
Examples