Author Topic: Some possible bugs  (Read 2859 times)

0 Members and 1 Guest are viewing this topic.

Offline Ed Ferris

  • Newbie
  • Posts: 3
    • View Profile
Some possible bugs
« on: October 12, 2020, 03:40:17 pm »
Hello!  I just downloaded QB64 and am using it to edit a program I wrote in the Ubuntu Text Editor.  (QB64 won't run on my Ubuntu since I don't have C++ and the DOS emulators I've found don't work with BASIC45.exe.)  Here are some differences I found from BASIC 4.5 as I remember it:

ELSE <line number> is an error, you now have to supply ELSE GOTO <line number>
A variable declared AS STRING in a TYPE statement causes an "illegal string to numeric conversion" error when you assign a string to it later.  Suffixing the name with "$" eliminates the error, but makes me wonder if the value will be stored correctly.
Forward references to line numbers that are not defined yet are flagged as errors.  This is very annoying.

I'm going to get a new Chromebook and see if QB64 will actually run on it (without landing me in Dependency Hell).
Meanwhile, the editor is useful.


Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Some possible bugs
« Reply #1 on: October 12, 2020, 04:03:27 pm »
Welcome to forum Ed,

Quote
A variable declared AS STRING in a TYPE statement causes an "illegal string to numeric conversion" error when you assign a string to it later.

Quote
Forward references to line numbers that are not defined yet are flagged as errors.  This is very annoying.

Show me a code snippet, these don't sound right, using QB64 v1.4?

FellippeHeitor

  • Guest
Re: Some possible bugs
« Reply #2 on: October 12, 2020, 05:12:56 pm »
Did you run the setup script?

Offline Ed Ferris

  • Newbie
  • Posts: 3
    • View Profile
Re: Some possible bugs
« Reply #3 on: October 12, 2020, 06:01:04 pm »
Another thing I just noticed is that this webpage doesn't allow typing in the Password -- I have to copy and paste it from a text editor.  Not the only page on which it has happened, but a typical example of how the Internet is breaking down.  Maybe you youngsters won't believe that pages loaded faster in the 28K modem era because they didn't have FETCH commands.

The setup script gave me the error messages at "### QB64 didn't compile".  When I tried to APT-GET the C++ compiler (both GCC and G++), it needed other packages, which needed other packages installed, at which point I gave up. 

The editor flags forward references, but will go past them, unlike unresolved errors.

An example of the conversion error:
TYPE SWColor
SWName as string * 6
SWHex as string * 6
END TYPE
SWColor.SWName="X" gives the error.



Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Some possible bugs
« Reply #4 on: October 12, 2020, 06:19:38 pm »

An example of the conversion error:
TYPE SWColor
SWName as string * 6
SWHex as string * 6
END TYPE
SWColor.SWName="X" 'gives the error.

for this example you are missing the DIM myvariable as SWColor
you have to dim a variable to use your type before you can use it.
Example:
Code: QB64: [Select]
  1. TYPE SWColor
  2.  SWName as string * 6
  3.  SWHex as string * 6
  4.  
  5. DIM SWC AS SWColor
  6.  
  7. SWC.SWName="X"
  8.  
  9. PRINT SWC.SWName
  10.  
« Last Edit: October 12, 2020, 06:22:28 pm by Cobalt »
Granted after becoming radioactive I only have a half-life!

Offline Ed Ferris

  • Newbie
  • Posts: 3
    • View Profile
Re: Some possible bugs
« Reply #5 on: October 12, 2020, 06:41:37 pm »
Thank you!  I now remember that step was necessary.