1.

Solve : gwbasic writing to a file in a different directory.?

Answer»

i am re using one of my old gwbasic files but it save/writes to the wrong directory/folder

COULD someone tell me the line to write to the correct directory.      e.g. c:form\fred

i use it on 32 bit vista .



OPEN "B:TEMP" FOR INPUT AS #1



it is writing my file to the windows directory system32 and i am unable to set up a short CUT to this and have to look for it and it takes too long.  i need the file to write to a normal folder so that i can put a shortcut and to read the output quickly.
Quote from: topsy99 on August 05, 2016, 10:28:01 PM

i am re using one of my old gwbasic files but it save/writes to the wrong directory/folder

OPEN "B:TEMP" FOR INPUT AS #1

it is writing my file to the windows directory system32

The line above is a file your BASIC program is reading from, not saving to.


Right click and open the properties of your shortcut.
Look for a box with the name "Start in:"

Type the path you want your file saved to in that box.  Save and test that.  Don't make any typing errors.

That may or may not work - it depends on the script and aspects of your computer.i cant quote the actual line e.g. opening or writing as i am on a windows 10 computer at present away from home and cant replicate the line.

the file is on this computer but windows says cant read due to this being 64 bit.

will try your solution when i get home.

thanksin further explanation.  My gwbasic comes up on a shortcut.   i then run the gwbasic file     it then saves to a txt file.    but i want the txt file to save in a different directory.       assume.     fred to be the current directory   i want it to save to c:\harry   how do i tell it in the open file line.

Quote
assume.     fred to be the current directory   i want it to save to c:\harry   how do i tell it in the open file line.

Enter the full path.

Code: [SELECT]OPEN "C:\harry\file.txt" FOR OUTPUT AS #1


Discussion

No Comment Found