A peculiar bug with Tab & Using
#1
I've noticed an error now - QB64 3.3.0. In the case of "TAB", the editor doubles the "Using" as soon as one do something again after the correction.
It is also strange that sometimes an error message appears and sometimes not.

[Image: Using-verdoppelt-QB64-3-3-0.jpg]
Reply
#2
I can confirm this behavior. Try the simple code below:

Code: (Select All)
? tab(4) using "###"; foo

Hit ENTER and watch as the auto-formatter tosses out the messed up line of junk:

Code: (Select All)
Print Tab(4)using Using "###"; foo

The end-user fix here is for the user to make certain that they use a semi-colon after the TAB, but the IDE isn't catching that error (usually it auto inserts the semicolons into a PRINT statement as needed). Something is just slightly off between the TAB and the auto-semicolon insertion routine.
Reply
#3
(10-15-2022, 01:31 PM)SMcNeill Wrote: I can confirm this behavior.  Try the simple code below:

Code: (Select All)
? tab(4) using "###"; foo 

Hit ENTER and watch as the auto-formatter tosses out the messed up line of junk:

Code: (Select All)
Print Tab(4)using Using "###"; foo

The end-user fix here is for the user to make certain that they use a semi-colon after the TAB, but the IDE isn't catching that error (usually it auto inserts the semicolons into a PRINT statement as needed).  Something is just slightly off between the TAB and the auto-semicolon insertion routine.

Must be still connected to this one https://qb64forum.alephc.xyz/index.php?t...#msg101641

However, that particular problem was fixed shortly after by Fellippe, either it returned (did not check the examples in that post) or it's at least something similar.

EDIT:
Just see that post states that there was another TAB issue fixed, maybe this is some mutual exclusive thing, fixing the first TAB issue caused the issue in that post and fixing that one re-introduced the original TAB issue Huh
Reply
#4
That's how it works:

Code: (Select All)
Dim As Double zahl

zahl = 123.77
Print Tab(4); Using "####.##"; zahl

Code: (Select All)
    Print Tab(4); "Kilowatt   : ", Motorrad.Kilowatt
    Print Tab(4); "Fahrgewicht: ", Motorrad.Fahrgewicht
    Print Tab(4); Using "Preis      : #####.##"; Motorrad.Preis
    Print
    Print Tab(4); "---------------------------------"
    Print

The IDE has its own imagination as well. . .  Big Grin
Reply
#5
When you guys check the source code, make sure some jackass didn't assign the variable "h" to the Tab function.

Pete
Reply
#6
A similar problem: Tab is 2 but it keeps going back. That is new!

Code: (Select All)
Dim As Integer SatzNummer

SatzNummer = 1
If SatzNummer = 1 Then Screen _NewImage(800, 600, 32)
Cls
Print "Hallo!"

End
Reply
#7
Now I know what is causing the IDE to behave in a confused manner, it is "Screen _NewImage()". If one remove it from "If", the IDE behaves normally again.

[Image: IDE-New-Image.jpg]
Reply
#8
I laugh my head off! Uh no, only half dead! - This is how everything works again  Tongue :

Code: (Select All)
'Bild in neuem Fenster aufrufen

Dim As Integer SatzNummer
Dim Bild As Long, myFont As Long
Dim Text As String
', Text2 As String


Input "Satznummer: ", SatzNummer

If SatzNummer = 1 Then
  Screen _NewImage(800, 600, 32)
  Cls
  'Neue Farbe setzen
  Color _RGB32(255, 165, 0), _RGB32(0, 0, 0)

  Bild = _LoadImage("..\Bilder\Yamaha-250-1965.jpg")

  'Neues Fenster - Bildgroesse fuer mittig
  _PutImage (((800 - 689) / 2), 15), Bild

  Text = "Die Yamaha als Zweitakter mit 250 ccm - 1965"
  'Text2 = " and leaves before she is left."
  myFont = _LoadFont("C:\Windows\Fonts\Tahoma.ttf", 25, "")
  _Font myFont

  'Zeile, Spalte und die Bildhoehe(!) beruecksichtigen
  _PrintString (135, 490), Text
  '_PrintString (256, 537), Text2

  'Farbe und Schrift zuruecksetzen
  Color _RGB32(255), _RGB32(0, 0, 0)
  _Font 16
  _FreeFont myFont

End If

I want to transfer this to the database. The corresponding motorcycle should be displayed for each specific record call.

[Image: Yamaha2022-10-15-234250.jpg]
Reply




Users browsing this thread: 4 Guest(s)