Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 change save to disk directory
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
guttface




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: 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!
AsianSensation




PostPosted: 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
Delos




PostPosted: 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

guttface




PostPosted: 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?
Delos




PostPosted: Wed Feb 11, 2004 7:50 pm   Post subject: (No subject)

Dir.Current
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: