Author Topic: QuickBASIC 4.5 binary format detected  (Read 199 times)

QuickBASIC 4.5 binary format detected
« on: January 11, 2019, 05:08:30 PM »
Hi all

This is probably explained somewhere on the site but I'm a man, I don't read manuals ;-)

I've just dug out some qb stuff I wrote many years ago and thought I would have a look through them. When I'm trying to load any of them I get the message 'QuickBASIC 4.5 binary format detected. Convert to plain text ?' If I select 'N' I get returned to the directory listing. If I press 'Y' it tries to convert but then comes up with 'Conversion failed'. Is there any way to load my old programmes?
Oh look - a sig file :-)

Offline SMcNeill

  • QB64 Developer
Re: QuickBASIC 4.5 binary format detected
« Reply #1 on: January 11, 2019, 05:21:12 PM »
Can you share an old file which fails to convert?

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: QuickBASIC 4.5 binary format detected
« Reply #2 on: January 11, 2019, 05:24:53 PM »
Can you share an old file which fails to convert?

Our converter is quite reliable but still in beta. If you can do as Steve suggested above that'd be helpful.

Offline Pete

  • Cuz I sez so, varmint!
Re: QuickBASIC 4.5 binary format detected
« Reply #3 on: January 11, 2019, 05:33:51 PM »
Get a copy of DOSBOX and run a copy of QB45 in it. That will allow you to open your QB files, and re-save them in text format.

Pete

Re: QuickBASIC 4.5 binary format detected
« Reply #4 on: January 11, 2019, 05:54:11 PM »
Hopefully it's attached to this message. I can't even remember what it does and please be gentle with me - it was written back in 1994!
Oh look - a sig file :-)

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: QuickBASIC 4.5 binary format detected
« Reply #5 on: January 11, 2019, 07:22:30 PM »
Our conversion tool indeed doesn't like something in your file although it loads fine in QuickBASIC 4.5.

Thanks for providing the file, we'll use it to improve the converter.

Please find attached your original program converted to plain text.

PS: Because RIGHT$ is a keyword, QB64 doesn't like the word right being used as a label and you'll have to correct that manually.

Offline Cobalt

  • At 60 I become highly radioactive!
Re: QuickBASIC 4.5 binary format detected
« Reply #6 on: January 12, 2019, 12:12:40 AM »
hey Fellippe, the line that kills the conversion seems to be line #615 in the program which is just a plain old "END"
but if you delete this line and save it in QB45 format QB64 has no problem converting it.

Just FYI, not sure if that might help debug the converter or not.
Granted after becoming radioactive I only have a half-life!

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: QuickBASIC 4.5 binary format detected
« Reply #7 on: January 12, 2019, 06:31:30 AM »
hey Fellippe, the line that kills the conversion seems to be line #615 in the program which is just a plain old "END"
but if you delete this line and save it in QB45 format QB64 has no problem converting it.

Just FYI, not sure if that might help debug the converter or not.

Thanks for looking, Cobalt. I had found the issue to be an unknown token of hex value 8C. Turns out Qarnos had already predicted/found out this would happen but left it commented out because, as comment in code states, he had never "seen one of these in the wild". The fix for this had been planned for years by him.

Using this sample file I also found a bug in the processing of old programs using PCOPY, as the parameters would be converted/read in reverse order. We kill two birds with one stone today.

Next version of QB64 will be a tad smarter in converting from QB4.5 binary files.

Re: QuickBASIC 4.5 binary format detected
« Reply #8 on: January 12, 2019, 06:58:16 AM »
I'm glad one of my old files could be of help. I'll see if I can find any more files to break QB64 even more ;-)
Oh look - a sig file :-)

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: QuickBASIC 4.5 binary format detected
« Reply #9 on: January 12, 2019, 07:03:33 AM »
I'm glad one of my old files could be of help. I'll see if I can find any more files to break QB64 even more ;-)

As weird as it may sound, that'd actually be great! Thanks for helping us improve it. I'll let you know once the dev build contains the fix above so you can keep using it, since it'll be fixed for the initial problem.