Project

General

Profile

Actions

Bug #322

closed

True and false not always treated as numeric constants (UPDATED). Also, not all boolean expressions are parsed properly.

Added by Brian Flanagan over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
03/27/2020
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

Example: (Assuming a PC manifest where True = 1)

Print True,True=1,Str$(True)
Print False,False=1,Str$(False)
X=True : Y=X+1 : Z=X+2
Print X,Y,Z

Result: (Note the NON-NUMERIC results, and that the boolean operation in the middle is NOT parsed!)
Note also that the only correct results are the 2 and 3 in the third row.

 true    true 1  true
 false   false 0  false
 true    2       3

Result should be (with PC manifest):

 1   1   1
 0   0   0
 1   2   3

Result should be (with Amiga manifest):

-1   0  -1
 0   0   0
-1   0   1
Actions #1

Updated by Francois Lionet over 4 years ago

  • Status changed from New to Resolved
  • Assignee set to Francois Lionet
  • Target version set to 0.9.8.1

OK. Fixed. I was reluctant to do this because in Javascript, "True" is not the same as "1". It is a type of its own, and I feared it would mess up comparisons that solve to if ( 1 == true ), but I have checked and it seems to work, in PC mode it is OK.
What is more problematic is in Amiga mode, if you do if ( -1 == true ) (the -1 being returned by another expression, understand that here I am talking about the FINAL comparison after the solving of a long one), it will not work. Yet, this might never happen as I see no cause for it to happen (complex to explain), but by following your advice Brian, I might have open a can of worms!

Be sure I will be ready to transfer the blame on you if this happens! ;)

Actions #2

Updated by Brian Flanagan over 4 years ago

LOL! OK. Make me the scapegoat if something else breaks. ;-)
That's why I gave you examples for what the results should be in either manifest.

Thank you!

Actions #3

Updated by Brian Flanagan over 4 years ago

  • Status changed from Resolved to Closed

Oops. Forgot to close the issue! Working in 0.9.8.1

Actions

Also available in: Atom PDF