change save to disk directory
Author |
Message |
guttface
|
Posted: Tue Feb 10, 2004 9:44 pm Post subject: change save to disk directory |
|
|
hey. i'm making a game which saves high scores to a file using code: | open : streamNumber,filename, put | how do i control where the file gets created? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Tue Feb 10, 2004 10:45 pm Post subject: (No subject) |
|
|
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 |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
AsianSensation
|
Posted: Tue Feb 10, 2004 10:48 pm Post subject: (No subject) |
|
|
code: | 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)
code: | var fileout : int
open : fileout, "C://My Documents//highscore.txt", put |
|
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Wed Feb 11, 2004 2:35 pm Post subject: (No subject) |
|
|
Or, you could go the Dir way:
code: |
var file : int
var dirName : string := "C:\\Turing\\Programmes\\Game\\Score\\"
Dir.Change (dirName)
open : file, "highScore.txt", put
% Everything in here.
close : file
|
|
|
|
|
|
![](images/spacer.gif) |
guttface
|
Posted: Wed Feb 11, 2004 6:50 pm Post subject: (No subject) |
|
|
Its a double backspace "\\" . How do you get the directory of the curently running file? |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Wed Feb 11, 2004 7:50 pm Post subject: (No subject) |
|
|
Dir.Current |
|
|
|
|
![](images/spacer.gif) |
|
|