Qbasicnews.com

Full Version: I think I've found a minor omission from the parser.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For a = 1 to 100
for b = 1 to 100
pset a,b,a+b and 255
next b,a


It spits out a compiler error "expected NEXT, found ,"
You love NEXT with multiple identifiers eh? heh

QB is the only language that allows that, i didn't want to add it, but seem as it is/was used, i added a "hack" to the parser today that makes it accept that construction, it will be up on the next release.


Btw, docs/keywords.txt shows that difference, among all others to QB.
Also, the SHARED keyword, which allows you to get a variable from a previously run function, doesn't seem to register.

declare sub foo ()
dim a as integer

foo()

sub foo ()
shared a
end sub
That isn't supported (also shown in docs/keywords.txt, nobody seems to read it ;), it's another QB-only hack i don't plan to add - wth, turning a module variable that was supposed to be non-global as global just inside a sub-routine? Makes no sense to me.

As a plus you can use STATIC with any kind of var and array, it's not limited as in QB.
That's fine, it's just a PITA because I'm porting 10k lines of code and a couple of these things are coming up quite a bit.

It's also odd that the compiler treats symbols at the end of a variable as a redeclaration of the variable.

I'm having to remove a lot of %s and $s. Smile