LB Booster
« If Them w/o compiler error »

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



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: If Them w/o compiler error  (Read 597 times)
FBack
New Member
Image


member is offline

Avatar




PM


Posts: 10
xx If Them w/o compiler error
« Thread started on: Feb 23rd, 2014, 1:43pm »

Yesterday I made an syntax error in 'If Then' command, instead 'Then', I wrote 'Them' I overlooked this error and I just only compile the program.

Compiling without error, but program is not working correct. What is wrong? Simple Typo!

Example:

Code:
StringVar$ = "1"
AnotherString$ = "3"
if StringVar$ = "1" theM AnotherString$ = "2" else AnotherString$ = "1"
print AnotherString$ 


Produce 3, which is wrong, it should be 2

But if 'If Then' statement' is not true (the some problem exist with numeric variables), this code work

Example:

Code:
StringVar$ = "2"
AnotherString$ = "3"
if StringVar$ = "1" theM AnotherString$ = "2" else AnotherString$ = "1"
print AnotherString$ 


Produce 1

The same error I noticed in LBB version 1.84, 2.40 and 2.43
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: If Them w/o compiler error
« Reply #1 on: Feb 23rd, 2014, 2:17pm »

on Feb 23rd, 2014, 1:43pm, FBack wrote:
Compiling without error, but program is not working correct. What is wrong? Simple Typo!

When LBB was originally written, the assumption was that you would always test and debug the program in Liberty BASIC first (that's why it's called LB Booster!). For that reason LBB does very little syntax checking itself: it expects the program already to be 'correct'.

If you work only with LBB, rather than first testing your program with LB, the lack of syntax checking can be an issue, as you have found. I'll see if there's a simple change which would flag that specific typo as an error, but adding extensive syntax checking would be a lot of work.

Edit: I have made a change so that the next release of LBB will flag that, and similar, typos as an error.

Richard.
« Last Edit: Feb 23rd, 2014, 2:45pm by Richard Russell » User IP Logged

FBack
New Member
Image


member is offline

Avatar




PM


Posts: 10
xx Re: If Them w/o compiler error
« Reply #2 on: Feb 23rd, 2014, 6:24pm »

It's true, my mistake, I should first check the code in JustBasic.

The only problem is that, you wrote so convenient compiler and I'm regularly forgetting to do it.
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