Author Topic: A .exe file pops up in the qb64 directory when running a code  (Read 4109 times)

0 Members and 1 Guest are viewing this topic.

Marked as best answer by mrhuman on February 03, 2021, 07:48:46 pm

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #15 on: February 04, 2021, 12:40:31 am »
I understand what you are asking for, but as Fellippe pointed out, this is not like QB45. When you ask to QB64 to run the code, it *must* generate the exe. The code does not run somewhere "within" the qb64 environment. It's for this reason that certain things aren't included in the modern IDE - such as the F8 key for stepping. That kind of thing is completely undefined here.

tldr: the exe is always created, it's a law
You're not done when it works, you're done when it's right.

Offline mrhuman

  • Newbie
  • Posts: 10
    • View Profile
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #16 on: February 04, 2021, 12:43:15 am »
@STxAxTIC
Yeah auto deleting is bad.
I thing I lost a video because of windows 10's storage sense thing.

Reply to latest comment
So QB64 is sorta like visual studio? And what I am asking is like I am asking it to not make an exe to test the software

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #17 on: February 04, 2021, 12:44:49 am »
Define "test the software". If any part of that statement means "run" the code, you need the entire exe. Basically how you see it work now is the only way it can work. QB64 is not "like" any other product, really.
You're not done when it works, you're done when it's right.

Offline mrhuman

  • Newbie
  • Posts: 10
    • View Profile
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #18 on: February 04, 2021, 12:48:03 am »
Ok then
Thanks!
To @STxAxTIC
I am marking your reply as the answer
Signing out

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #19 on: February 04, 2021, 01:10:09 am »
Write a little program to check your folders for you, run QB64, and then do clean up, if necessary...

Like this one:

Code: QB64: [Select]
  1. _TITLE "QB64 Auto-cleanup"
  2.     FUNCTION load_dir& (s AS STRING)
  3.     FUNCTION has_next_entry& ()
  4.     SUB close_dir ()
  5.     SUB get_next_entry (s AS STRING, flags AS LONG, file_size AS LONG)
  6.  
  7. REDIM Dir(0) AS STRING, File(0) AS STRING
  8. REDIM Dir2(0) AS STRING, File2(0) AS STRING
  9.  
  10. GetFileList _CWD$, Dir(), File()
  11.  
  12. SHELL "QB64.EXE"
  13.  
  14. GetFileList _CWD$, Dir2(), File2()
  15.  
  16. FOR i = 1 TO UBOUND(dir2)
  17.     flag = 0 'not found
  18.     FOR j = 1 TO UBOUND(dir)
  19.         IF Dir2(i) = Dir(j) THEN flag = -1: EXIT FOR
  20.     NEXT
  21.     IF flag = 0 THEN PRINT Dir2(i); " is a new directory."
  22. FOR i = 1 TO UBOUND(File2)
  23.     flag = 0 'not found
  24.     FOR j = 1 TO UBOUND(File)
  25.         IF File2(i) = File(j) THEN flag = -1: EXIT FOR
  26.     NEXT
  27.     IF flag = 0 THEN PRINT File2(i); " is a new file."
  28.  
  29. SUB GetFileList (SearchDirectory AS STRING, DirList() AS STRING, FileList() AS STRING)
  30.     CONST IS_DIR = 1
  31.     CONST IS_FILE = 2
  32.     DIM flags AS LONG, file_size AS LONG
  33.  
  34.     REDIM _PRESERVE DirList(100), FileList(100)
  35.     DirCount = 0: FileCount = 0
  36.  
  37.     IF load_dir(SearchDirectory) THEN
  38.         DO
  39.             length = has_next_entry
  40.             IF length > -1 THEN
  41.                 nam$ = SPACE$(length)
  42.                 get_next_entry nam$, flags, file_size
  43.                 IF flags AND IS_DIR THEN
  44.                     DirCount = DirCount + 1
  45.                     IF DirCount > UBOUND(DirList) THEN REDIM _PRESERVE DirList(UBOUND(DirList) + 100)
  46.                     DirList(DirCount) = nam$
  47.                 ELSEIF flags AND IS_FILE THEN
  48.                     FileCount = FileCount + 1
  49.                     IF FileCount > UBOUND(filelist) THEN REDIM _PRESERVE FileList(UBOUND(filelist) + 100)
  50.                     FileList(FileCount) = nam$
  51.                 END IF
  52.             END IF
  53.         LOOP UNTIL length = -1
  54.         close_dir
  55.     ELSE
  56.     END IF
  57.     REDIM _PRESERVE DirList(DirCount)
  58.     REDIM _PRESERVE FileList(FileCount)
  59.  

Run it, it stores a list of all files and directories in the folder where QB64 is.
The it starts up QB64.
When QB64 ends, it unhides itself and then prints you a list of all the new folders or directories that have appeared in the QB64 folder.

Now, I'm not doing anything with those files or folders, as I don't believe in messing with other folks drives, but all you'd have to do is now KILL them out of existence, if you so desired...
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: A .exe file pops up in the qb64 directory when running a code
« Reply #20 on: February 04, 2021, 04:05:08 am »
It is not practical to have QB64 delete the executable made when you press F5, because the IDE doesn't know when the program has finished executing.