LB Booster
Programming >> Liberty BASIC language >> includesKey not understood http://lbb.conforums.com/index.cgi?board=lblang&action=display&num=1461686629 includesKey not understood
Post by Richard Russell on Apr 26th, 2016, 4:03pm
Liberty BASIC is arguably inconsistent in the way parameters are passed to functions and subs. A function's formal parameters must be enclosed in parentheses but a sub's formal parameters must not be enclosed in parentheses.
If you accidentally put a sub's formal parameters in parentheses LB doesn't detect the problem at 'compile time' but issues the non-obvious "includesKey:" not understood error at runtime:
Code:
call world b$
print b$
end
sub world (byref b$)
b$ = "Hello world!"
end sub
Fortunately LBB detects the problem at compile time and reports a 'Syntax error' before even trying to run the program.
I don't want to imply that LBB is always better at reporting errors than LB - that is far from the case - but in this specific instance it happens to be.