LB Booster
« two instructions on one line; no colon »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:54am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: two instructions on one line; no colon  (Read 221 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx two instructions on one line; no colon
« Thread started on: Jan 10th, 2017, 4:26pm »

This is a minor quibble. I'm just curious why it did not fail.
(it did fail in LB4.5)

Code:
rptOpen=1    printCount = 0 
 


I tested with a 'notice' command and found that rptOpen did equal 1, and printCount did equal 0.

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: two instructions on one line; no colon
« Reply #1 on: Jan 10th, 2017, 9:29pm »

on Jan 10th, 2017, 4:26pm, Alincon wrote:
I'm just curious why it did not fail.

The short answer is because the program still makes perfect sense without the colon (as you've noted yourself LBB executes the code correctly). To maximize execution speed at run-time the LBB interpreter doesn't bother to check for, nor to report, syntax errors that don't actually matter.

Of course it would be possible for LBB to detect the error at the 'compilation' stage; it doesn't need to wait until run-time to do so. The fact that it doesn't in this case is partly an accident and partly because originally the expectation was that LBB would only be used to 'boost' a program that had been successfully compiled and tested in LB 4.04, so syntax checking was not a high priority.

When LBB was developed to be more self-contained and capable of being used on its own, the syntax checking and error reporting should have been improved. But, as I've discussed here previously, they weren't and some coding errors that could usefully be reported aren't. It's not ideal, but trying to retro-fit more checking at this stage would be difficult and risky.

I should add that the reverse situation also sometimes applies. This code (taken from freeform404.bas) executes perfectly in LB 4.04, with no error or warning being reported, but does not run in LBB because of the mis-matched parentheses:

Code:
    if mid$(mi$,brl,1)=chr$(0)) then brk=brl
 

Richard.
« Last Edit: Jan 10th, 2017, 9:34pm by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls