else
if ... then ... end if
のつなぎに使われるコマンド。 前の条件式がFalseの場合にのみ次のブロックが実行される。
書式:
if
condition expression then
条件が真の場合に実行されるコマンド
else
条件が偽の場合実行されるコマンド
end if
例:
setautoback(50)
prints("press a number key")
waitKey
x$=chr$(inkey)
if x$="1" then
prints("press 1")
elseif x$="2" then
prints("press 2")
else
prints("press other key")
end if
if x$="4" then :prints("good bye"):end if
prints("press esc to exit")
waitKey (27)
参照: if ...
then ... end if, elseif