GLBasic forum

Main forum => Bug Reports => Topic started by: bigsofty on 2009-Nov-06

Title: IF statement error?
Post by: bigsofty on 2009-Nov-06
This does not work...

Code (glbasic) Select
a$ = "a"
IF a$<>"" THEN DEBUG "a$ not blank"


There are ways around this, checking for the length of the string, ELSEIF etc... but there all workarounds. This could be very confusing for a GLB beginner.

Request: It would be great if good old logical NOT was supported in the IF statements.
Title: Re: IF statement error?
Post by: Moru on 2009-Nov-06
That code works fine for me with version 7.078. What version are you running?
Title: Re: IF statement error?
Post by: bigsofty on 2009-Nov-06
Thanks Moru, weird problem.

Now I am confused, if I run the above code as a new project, it runs as expected.

If I insert the code into my own project, it does not work?

I'll do a little experimenting to see if I can see if I highlight the problem better...  :doubt:
Title: Re: IF statement error?
Post by: bigsofty on 2009-Nov-06


Pah, previous compile run created a dead process in memory... killed it off an it ran fine.

Thanks for your help Moru ;)

P.S. I would still like to be able to use NOT in an IF statement though :P
Title: Re: IF statement error?
Post by: Moru on 2009-Nov-06
Try if bNOT is doing what you want, I'm not totally sure it will work as you expect it :-)
Title: Re: IF statement error?
Post by: MrTAToad on 2009-Nov-06
BNOT is for binary stuff, not logical...
Title: Re: IF statement error?
Post by: Moru on 2009-Nov-06
yes, I was expecting that since true in GLBasic is 1, not -1. So it's not working.