Qbasicnews.com

Full Version: open changes working directory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i tried using open and the next time i used it it didn't work since i was using a relative path but the first one took me into a different directory. Cry and it wouldn't be so bad if the first file i opened wasn't in a variable, otherwise i could just add a ".." but it's in a variable so i can't...

Code:
'dir structure:
' bas file
' [dir1]
' `-a file
' another file
'
' compile with -e
open "dir1/a_file.txt" for input as #1
close #1
open "another_file.txt" for input as #1
close #1
print "success!"
sleep
Do you mean the second file you tried to open is in the root directory?
yes.