Author Topic: A lesson on how to break QB64  (Read 3180 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
A lesson on how to break QB64
« on: January 24, 2022, 01:31:18 pm »
A glitch which I learned about which basically just kills QB64 completely.... Can't save a file.  Can't compile a file.  Can't do anything until you close QB64 completely and restart it.

Step 1:  Make a directory.  I'll call mine "/foo"
Step 2:  Write a program and save it in that directory.   Mine is PRINT "Hello World", and I saved it as "HW.bas" inside "/foo".
Step 3:  Go to Windows Explorer and rename the "/foo" directory to "/whatever".

Congrats!!  QB64 will now explode and smoke and cry and refuse to do anything.  The IDE wants to save to "/foo", but there is no "/foo" on the drive anymore..  The linker wants to link to "/foo", but there is no "/foo"...  As far as I could tell, there was absolutely nothing that I could do with QB64 once "foo" became "whatever"...

The only solution to the issue is to completely shut down QB64 and restart it.  Once its got an invalid directory locked into memory, QB64 seems to refuse to let it go!

Just a funny quirk which I thought I'd share, and its not something which isn't easily worked around:  Simply don't rename the folder you're working from while working from it!  If you do, Qb64 goes, "Ummmm?????"
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: A lesson on how to break QB64
« Reply #1 on: January 24, 2022, 02:39:54 pm »
Hi. Maybe this can be solved by adding the Lock command to the IDE? This ensures that nothing - only the IDE can manipulate with the file on the disk. Maybe it would also like to check if each path and file exists before each compilation?

Offline CharlieJV

  • Newbie
  • Posts: 89
    • View Profile
Re: A lesson on how to break QB64
« Reply #2 on: January 24, 2022, 05:41:51 pm »
QB64 (Linux) version 2.0.2 running on my Linux-Enabled Chromebook.

Step 1:  Made a directory.  I called mine "/foo"
Step 2:  Wrote a program and saved it in that directory.   Mine is PRINT "Hello World", and I saved it as "HW.bas" inside "/foo".
Step 2.1: Compiled and ran the app (sanity check)
Step 3:  Went to Chromebook's "Files" app and renamed the "/foo" directory to "/whatever"
Step 4: I had left QB64 running on another display.  Set the focus back to it and tried to start the program and got compile errors.
Step 5: Went to QB64's file menu, and clicked "Save As".  Left the filename unchanged, but went into "/whatever", and saved (overwriting the file last saved there.)
Step 6: Program still not compiling, scratched my head a bit.
Step 7: Added a couple of spaces after "Hello World"
Step 8: Compiled and ran A-1

So kind of quirky, but not horrible.  Then again, I am a stone's throw away from "what am I doing in a room I just stepped into?"  (i.e. might forget I've got a file open in a directory while I'm changing the directory name.)

Give the same steps a try with QB64 running on your Windows rig.  If Windows is not as graceful-ish as what I've found in the steps above, might I suggest (tongue majorly in cheek; um, the cheek above my neck): you might want to consider selling your soul to Google and switching to Chromebook?  Come on over to this side of the Cuckoo's Nest ...
« Last Edit: January 24, 2022, 08:01:01 pm by CharlieJV »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: A lesson on how to break QB64
« Reply #3 on: January 24, 2022, 07:15:11 pm »
You must be using Wincraps 10 or above, Vista gives no such problems with the QB64 IDE.
Granted it cant save, just gives the error "Cannot Save file", but I can Save As with no issues
It compiles and runs just fine, and when I try to load a file still tries to load from Foo which is funny cause its not there anymore!

But the IDE seems to run just fine. tried this with 1.5 and 2.0.2
Granted after becoming radioactive I only have a half-life!