|
Post by jarych on Jun 11, 2019 20:17:54 GMT
Running a BAS file that comes with Just BASIC shows the path of the file run. On W10, seems to be ,.../username/appdata/roaming/JustBASIC/nameoffile.bas.
As I try to think of better choices for programs that we ourselves make, I would want to avoid Documents folder because that can get overstuffed with so many "documents" from other tasks on ones computer. An idea to choose might be something like C:/users/username/ourJBsourcefiles/ and then maybe other special subfolders can go into this ourJBsources, too.
|
|
|
Post by Stefan Pendl on Jun 15, 2019 6:26:06 GMT
If you organize your documents in sub-folders of "My Documents" the clutter shouldn't be that much. I use a structured "My Documents" folder as shown below. - My Documents
- Invoices
- Insurance
- Programming
- Source Code C
- Source Code Just BASIC
- Source Code Liberty BASIC
[/ul][/ul]
|
|
ntech
Junior Member
Posts: 99
|
Post by ntech on Jun 18, 2019 19:56:34 GMT
I just created a directory C://Users/Me/Programming/JustBasic/, and in it I have: - JB Games
- JB Database
- JB Misc
- .Backup
|
|
|
Post by jarych on Jun 19, 2019 4:08:06 GMT
I am trying to keep mine as no more than three subfolders under C:. I could do this with fewer subfolders.
|
|
|
Post by honkytonk on Jun 19, 2019 6:07:01 GMT
When we make a path from the root (C), this implies that we are going to put something else than in the current (concerned) folder (the one that contains the code). What is the point ?
|
|
|
Post by jarych on Jun 19, 2019 7:17:27 GMT
When we make a path from the root (C), this implies that we are going to put something else than in the current (concerned) folder (the one that contains the code). What is the point ? Obviously to be able to put BAS files under development into a path with less subfolders than what happens for "AppData". I find that looking for my programs under develpment in "AppData.." is not convenient and I like for my file paths to be well labeled but not as buried.
|
|
|
Post by Rod on Jun 19, 2019 8:13:33 GMT
When we program we can choose "hard" paths or "relative" paths. You would normally choose a "hard" path if you were dictating where files or folders should be placed, on installation for example. Or, if you know the "hard" path to shared resources.
If you wish to share your code with others and make it less prone to error you should always use "relative" paths for your own resources. So instead of c:\project\file you would write project\file. Project would be a sub folder of the current folder. That way you never need to know what the current folder is. It could be c:\user\project\file or it could be e:\basic\project\file In all cases you will find the file with the "relative" path project\file.
You can never be sure where a user will place your code.
Also browse DefaultDir$ and StartupDir$ in the help file.
|
|
|
Post by jarych on Jun 19, 2019 10:04:06 GMT
When we program we can choose "hard" paths or "relative" paths. You would normally choose a "hard" path if you were dictating where files or folders should be placed, on installation for example. Or, if you know the "hard" path to shared resources. If you wish to share your code with others and make it less prone to error you should always use "relative" paths for your own resources. So instead of c:\project\file you would write project\file. Project would be a sub folder of the current folder. That way you never need to know what the current folder is. It could be c:\user\project\file or it could be e:\basic\project\file In all cases you will find the file with the "relative" path project\file. You can never be sure where a user will place your code. Also browse DefaultDir$ and StartupDir$ in the help file. Programming is one thing. Using an application in Windows which makes files and choosing where to put the files is another thing. The point of the original post is Making the Choice of Which Path to put BAS files for JustBASIC -Created Programs. The many example programs which are packaged with JB are not in the same directory path in which I want to save the programs which I create. I just don't want to have to go there, folder by folder, to run or to find a file or its project folder. You see, here DefaultDir$ and StartupDir$ are unimportant. This topic is about where the programmer puts his files, but not where the file-being-developed puts its files. Again, a fictional example: I may work on a program and call it somethingspecial.bas, and I am using JustBASIC to create this program. I may save somethingspecial.bas in a folder dedicated to my JB projects, and this is in the path, C:\myprogrammingprojects\somethingspecial\, and so when saved, the full path of the file would be C:\myprogrammingprojcts\somethingspecial\somethingspecial.bas and further, when I work on this program and make a revision, I may include appendage "_rev" on the new file name. When I then save this, the full path without any special effort will be placed by JB into C:\myprogrammingprojects\somethingspecial\somethingspecial_rev.bas and there are now in this fictional example, two files in the subdirectory. They are somethingspecial.bas and somethingspecial_rev.bas, both in the subdirectory \somethingspecial\.
|
|
|
Post by Stefan Pendl on Jun 20, 2019 8:28:04 GMT
jarych, your point of view is well used by software developers. Generally any user can use any path he wants, most likely users choose an external disk to save their source code files. Just BASIC puts no restriction on the paths you use, only Windows does this due to security reasons and to protect you from malware. When it comes to file paths there is something more to remember: ANSI Windows API functions can only utilize paths up to 260 characters, whereas Unicode Windows API functions utilize 36kiB characters for file paths. Finally do as you see fit for your way of working.
|
|