93
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
...
case
1 :
'this expression has no code associated with it
case
2 :
'code 'x=5' belongs to this expression
x=5
...
Correct way to have a single block of code for two expressions is as follows:
...
case
1,2 :
'x=5 will be done both for 1 and 2
x=5
...
Examples
sub
print_weekday (weekday
as
byte
)
select
case
weekday
case
1
: ser.setdata(
"Monday"
)
case
2
: ser.setdata(
"Tuesday"
)
case
3
: ser.setdata(
"Wednesday"
)
case
4
: ser.setdata(
"Thursday"
)
case
5
: ser.setdata(
"Friday"
)
case
6
: ser.setdata(
"Saturday"
)
case
7
: ser.setdata(
"Sunday"
)
case
else
: ser.setdata(
"Did you just invent a new day?"
)
end
select
ser.send
end
sub
Sub Statement
Function:
-- distinct units in code which
perform specific tasks. These never return any value.
Syntax:
[ public ]
sub name [ ( [ byref ] argument1 as type1, [ byref ]
argument2 as type2…) ]
statement1
statement2
…
[exit sub]
…
statementN
end sub
Scope:
Global
See Also:
,
,
Part
Description
62
79
85
87