
-----------------------------------
guttface
Tue Feb 10, 2004 9:44 pm

change save to disk directory
-----------------------------------
hey. i'm making a game which saves high scores to a file using   open : streamNumber,filename, put how do i control where the file gets created?

-----------------------------------
Dan
Tue Feb 10, 2004 10:45 pm


-----------------------------------
for the file name u can put in a dir as well like:

"C:\\compscifiles\\dan\\myfile.ai"

note the \\ is need to relpace a noraml / in a dir line

-----------------------------------
AsianSensation
Tue Feb 10, 2004 10:48 pm


-----------------------------------
var fileout : int
open : fileout, "highscore.txt", put

when you are doing something like that, you can specify the string and add the path to specifiy where you want the file to be created. (I think, not sure which slash was it)

var fileout : int
open : fileout, "C://My Documents//highscore.txt", put

-----------------------------------
Delos
Wed Feb 11, 2004 2:35 pm


-----------------------------------
Or, you could go the Dir way:


var file : int
var dirName : string := "C:\\Turing\\Programmes\\Game\\Score\\"

Dir.Change (dirName)

open : file, "highScore.txt", put
% Everything in here.
close : file



-----------------------------------
guttface
Wed Feb 11, 2004 6:50 pm


-----------------------------------
Its a double backspace "\\" . How do you get the directory of the curently running file?

-----------------------------------
Delos
Wed Feb 11, 2004 7:50 pm


-----------------------------------
Dir.Current
