QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: badger on October 07, 2020, 11:23:33 am
-
Hello
I have need to put files my software creates in different directories. I have read somethings but my mind is not in the mood this morning to comprehend such high tech writings LOL so if someone would kindly point me in the correct directions i would appreciate it.
Thanks in advance
Badger
-
First of all are you talking about .bas files made with QB64?
I have to make directories, usually with Windows Explorer then I can save .bas files in the directories I made.
Then I make sure there is a bullet under Menu > Run > Output EXE to Source Folder,
so I can Run the files out of different folders.
-
hello
in my program i want to set files paths for data txt files my program will generate. there will be a menu options for this setup. I want to be able to enter the files paths into a random file then let the system decide if they exists if if not create them. i hope i am being clear here if you have a questions about what i have typed please please asks.
Badger
-
First of all are you talking about .bas files made with QB64?
I have to make directories, usually with Windows Explorer then I can save .bas files in the directories I made.
Then I make sure there is a bullet under Menu > Run > Output EXE to Source Folder,
so I can Run the files out of different folders.
You don't have to; we have a command for that: http://www.qb64.org/wiki/MKDIR
Generally speaking, all you need to do is type the file path into your program, where you open/access a file, along with the name.
Instead of: OPEN "temp.txt" FOR INPUT AS #1
You would: OPEN "C:\my dir\my subdir\temp.txt" FOR INPUT AS #1
-
bplus
please read my above post for what i need. i am sorry i was not more clear. as i said my mind seems a bit befuddled this morning
Badger
-
hello
in my program i want to set files paths for data txt files my program will generate. there will be a menu options for this setup. I want to be able to enter the files paths into a random file then let the system decide if they exists if if not create them. i hope i am being clear here if you have a questions about what i have typed please please asks.
Badger
DataPath$ = "C:\my dir\my subdir\"
IF _FILEEXISTS(DataPath$ + "temp.txt") THEN
'temp.txt exists inside the datapath
ELSE
'create the file
OPEN DataPath$ + "temp.txt" FOR OUTPUT AS #1
PRINT #1, "ScreenWidth = 640"
PRINT #1, "ScreenHeight = 480"
CLOSE
END IF
-
SMcneill
thats that give me a direction just have to figure out how the program should react on startup when nothing is set. I want the data files in there own directories random file, user info txt file, inventory text files and point of sale information in another.
Thanks very much
Badger