QB64 Bug -- multiple plusses or minusses

by qbguy (no login)

C:\qb64>copy con test.bas
a=2
b=3
c=a+++++b
PRINT c
^Z

C:\qb64>compile test.bas
QB64 COMPILER V0.50

COMPILING C++ CODE INTO EXE...
In file included from qbx.cpp:8481:
..\temp\main.txt: In function `int QBMAIN(void*)':
..\temp\main.txt:23: error: non-lvalue in increment
C++ COMPILATION FAILED!

I am guessing that this is because C++ interprets the multiple pluses as increment operators:

c = a++ + ++b

(or,)

c = a + b + 1
a=a+1
b=b+1

Using minuses also produces an error:

C:\qb64>copy con test.bas
a=2
b=3
c=a-----b
PRINT c
^Z

C:\qb64>compile test.bas
QB64 COMPILER V0.50

COMPILING C++ CODE INTO EXE...
In file included from qbx.cpp:8481:
..\temp\main.txt: In function `int QBMAIN(void*)':
..\temp\main.txt:23: error: stray '\241' in program
..\temp\main.txt:23: error: stray '\241' in program
..\temp\main.txt:23: error: expected primary-expression before ')' token
..\temp\main.txt:23: error: expected primary-expression before ')' token
C++ COMPILATION FAILED!

Posted on Feb 7, 2008, 4:31 PM
from IP address 75.0.228.87

Respond to this message   

Return to Index


Response TitleAuthor and Date
*Oh boy I use +++++++ all of the time. Talk about obfuscated? on Feb 10
*Thanks again qbguy, fixing that one is a very low priority atm! on Feb 13