Author Topic: Programming with Project Directories  (Read 2321 times)

0 Members and 1 Guest are viewing this topic.

Offline Timbergetter

  • Newbie
  • Posts: 6
    • View Profile
Programming with Project Directories
« on: October 19, 2020, 06:21:37 pm »
I am keen to set up my QB64 programming environment in a similar way to what I once had in QB4.5.  This involved having separate directories for each basic program project.  To test this I have placed the QB64 directory name in the path statement for the Windows 7 environment system variable list.  I have also checked the QB64 option box to save exe files to the source directories.  I then change to the program directory I wish to address and then execute the QB64.exe from the command line.  This seems to work fine for trivial “hello world” programs.  The only aberration I’ve observed so far is when compiling and running code before that source code has been saved.  In that case it seems that the untitled.exe file is saved to the QB64 directory,  and the _CWD$ statement returns the QB64 directory rather than the actual current working directory.  Once the source file has been updated and saved things seem to work as intended.

What I would like to know is whether my proposed setting up is valid in QB64.  Are there any resources in the QB64 directories that may not be found during compilation by virtue of the PATH setting? 

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Programming with Project Directories
« Reply #1 on: October 20, 2020, 10:49:58 am »
Yes what I do, except in Windows 10 without QB64 in PATH and not from COMMAND line and yes you have to save the source in project directory before running writing exe into that same project folder. Valid? It works fine for several years now! The only little snag to this one project one folder idea is making the new folder. I use Windows Explorer but Steve reminds we can make it directly from QB64 with MKDIR (I had to check spelling because I don't use that method because for me it easier to use Explorer and type in a new folder name right where I know I want.)

The only thing I've found (recently) is that QB64.exe has to be in PATH to compile programs in SHELL otherwise you have to be in QB64.exe folder to compile in SHELL (and that is too clunky to do anything little and fast and hidden).
And the question then becomes, "Why would anyone want to that anyway?"  ;-)) And if you are just getting over QB4.5 this is not something you need to worry about now, you need to learn all the lovely tools QB64.exe has for you to use.
« Last Edit: October 20, 2020, 11:08:09 am by bplus »