Author Topic: [fixed] possible editor bug  (Read 4747 times)

0 Members and 1 Guest are viewing this topic.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
[fixed] possible editor bug
« on: November 06, 2021, 09:37:38 am »
its not 2022 yet but i figured yall wanna know what i found whilst running windows 10, all-new qb64-everything as of last week. this problem arose maybe 3x recently, managed to capture it this time:

 
 

when i type (RND - .5) * whatever, the editor removes the .5 and throws the parentheses off.
« Last Edit: November 06, 2021, 05:03:42 pm by odin »
You're not done when it works, you're done when it's right.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: possible editor bug
« Reply #1 on: November 06, 2021, 10:45:12 am »
Confirmed:
(in all the pairs you see before comment removed then after (but comment added back in so I could test more)
Code: QB64: [Select]
  1.  
  2. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) + (Rnd - .5) * BlockSize
  3. 'x = BlockSize * (i - (UBound(WorldMesh, 1) / 2)) + (Rnd () * BlockSize
  4.  
  5. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) +  BlockSize * (Rnd - .5)
  6. 'x = BlockSize * (i - (UBound(WorldMesh, 1) / 2)) + BlockSize * (Rnd ()
  7.  
  8. 'x = BlockSize * (i - UBound(WorldMesh, 1) / 2) +  BlockSize * (Rnd - .5)   'seems like extra set () remove
  9. 'x = BlockSize * (i - UBound(WorldMesh, 1) / 2) + BlockSize * (Rnd ()       ' damn!
  10.  
  11. 'x = BlockSize * (i - UBound(WorldMesh) / 2) + BlockSize * (Rnd -.5)   ' is it 2nd dim of Ubound?
  12. 'x = BlockSize * (i - UBound(WorldMesh) / 2) + BlockSize * (Rnd ()  '  nope still bad!
  13.  
  14. ' x =  i - UBound(WorldMesh) / 2 +  (Rnd -.5)
  15. 'x = i - UBound(WorldMesh) / 2 + (Rnd ()     ' still bad!!!
  16.  
  17. 'x = 10 + 8* (Rnd - .5)
  18. 'x = 10 + 8 * (Rnd - .5)   ' OK
  19.  
  20. 'x = ubound(mesh) + 8* (Rnd - .5)
  21. 'x = UBound(mesh) + 8 * (Rnd ()   ' looks like problem with Ubound
  22.  
  23. 'x = sin(mesh) + 8*(rnd -.5)
  24. 'x = Sin(mesh) + 8 * (Rnd - .5) 'ok
  25.  
  26. Dim Mesh(10 To 20)
  27. 'x = lbound(mesh) + 8* (Rnd - .5)
  28. x = LBound(Mesh) + 8 * (Rnd () ' oops again!  and the M of Mesh is fixed!!!
  29.  
  30.  
  31.  

I suspect when the Case was fixed inside LBound, UBound something got messed up.

Running Windows 10 64 bit QB64 v2.0 going back to older QB64 versions....

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: possible editor bug
« Reply #2 on: November 06, 2021, 10:52:06 am »
Here is QB64 v1.4 all looks good
Code: QB64: [Select]
  1. ' QB64 v1.4
  2. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) + (Rnd - .5) * BlockSize
  3. x = BlockSize * (i - (UBOUND(WorldMesh, 1) / 2)) + (RND - .5) * BlockSize
  4.  
  5.  
  6. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) +  BlockSize * (Rnd - .5)
  7. x = BlockSize * (i - (UBOUND(WorldMesh, 1) / 2)) + BlockSize * (RND - .5)
  8.  
  9.  
  10. 'x = BlockSize * (i - UBound(WorldMesh, 1) / 2) +  BlockSize * (Rnd - .5)   'seems like extra set () remove
  11. x = BlockSize * (i - UBOUND(WorldMesh, 1) / 2) + BlockSize * (RND - .5)
  12.  
  13. 'x = BlockSize * (i - UBound(WorldMesh) / 2) + BlockSize * (Rnd -.5)   ' is it 2nd dim of Ubound?
  14. x = BlockSize * (i - UBOUND(WorldMesh) / 2) + BlockSize * (RND - .5)
  15.  
  16. ' x =  i - UBound(WorldMesh) / 2 +  (Rnd -.5)
  17. x = i - UBOUND(WorldMesh) / 2 + (RND - .5)
  18.  
  19. 'x = 10 + 8* (Rnd - .5)
  20. x = 10 + 8 * (RND - .5)
  21.  
  22. 'x = ubound(mesh) + 8* (Rnd - .5)
  23. x = i - UBOUND(WorldMesh) / 2 + (RND - .5)
  24.  
  25. 'x = sin(mesh) + 8*(rnd -.5)
  26. x = SIN(mesh) + 8 * (RND - .5)
  27.  
  28. DIM Mesh(10 TO 20)
  29. 'x = lbound(mesh) + 8* (Rnd - .5)
  30. x = LBOUND(mesh) + 8 * (RND - .5)  '<< note mesh still lower case
  31.  
  32.  
  33.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: possible editor bug
« Reply #3 on: November 06, 2021, 11:11:23 am »
QB64 v1.5 works OK but ran into problem DIM Mesh after I used Ubound(mesh) a couple times before last pair:
Code: QB64: [Select]
  1. 'QB64 v1.5
  2. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) + (Rnd - .5) * BlockSize
  3. x = BlockSize * (i - (UBound(WorldMesh, 1) / 2)) + (Rnd - .5) * BlockSize
  4.  
  5. 'x = BlockSize * (i - (Ubound(WorldMesh,1)/2)) +  BlockSize * (Rnd - .5)
  6. x = BlockSize * (i - (UBound(WorldMesh, 1) / 2)) + BlockSize * (Rnd - .5)
  7.  
  8. 'x = BlockSize * (i - UBound(WorldMesh, 1) / 2) +  BlockSize * (Rnd - .5)   'seems like extra set () remove
  9. x = BlockSize * (i - UBound(WorldMesh, 1) / 2) + BlockSize * (Rnd - .5)
  10.  
  11. 'x = BlockSize * (i - UBound(WorldMesh) / 2) + BlockSize * (Rnd -.5)   ' is it 2nd dim of Ubound?
  12. x = BlockSize * (i - UBound(WorldMesh) / 2) + BlockSize * (Rnd - .5) '  nope still bad!
  13.  
  14. ' x =  i - UBound(WorldMesh) / 2 +  (Rnd -.5)
  15. x = i - UBound(WorldMesh) / 2 + (Rnd - .5)
  16.  
  17. ' x =  i - UBound(WorldMesh) / 2 +  (Rnd -.5)
  18. x = i - UBound(WorldMesh) / 2 + (Rnd - .5)
  19.  
  20. 'x = ubound(mesh) + 8* (Rnd - .5)
  21. x = UBound(mesh) + 8 * (Rnd - .5)
  22.  
  23. 'x = sin(mesh) + 8*(rnd -.5)
  24. x = Sin(mesh) + 8 * (Rnd - .5)
  25.  
  26. 'Dim mesh(10 To 20)   '' this is red lined in QB64 v1.5 !!!!
  27. ReDim mesh(10 To 20) ' <<<<<<<<<< this refuses to stay with Mesh
  28. 'x = lbound(mesh) + 8* (Rnd - .5)
  29. x = LBound(mesh) + 8 * (Rnd - .5)
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  

FellippeHeitor

  • Guest
Re: possible editor bug
« Reply #4 on: November 06, 2021, 04:28:55 pm »
👍

FellippeHeitor

  • Guest
Re: possible editor bug
« Reply #5 on: November 06, 2021, 05:03:02 pm »
Fixed in the latest dev build. We'll be releasing a new stable release. Thanks @STxAxTIC for reporting and @bplus for the help in investigating.