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

Username:   Password: 
 RegisterRegister   
 assistance with writing to file
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Spider-Man




PostPosted: Wed Jan 16, 2008 8:09 pm   Post subject: assistance with writing to file

i am making a game and i would like to record the player names and high score and record them to a file
i can read the info from the file okay but when i put the two pieces of information to the file it seems that the two words are put into one
how would i write it so that each piece (player name and score) could be written with a space in between

open : inID, inName, put
for i : 1 .. numberOfScore %displays all the high scores
put : inID, highPlayers (i),(i want the space between the two here) highScores (i)
Font.Draw (intstr (i) + "-" + highPlayers (i) + ": " + intstr (highScores (i)), maxx div 2 - (textSize * 6), (maxy - textSize * 2) - (i * textSize), font, red)
end for
close : inID
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Jan 16, 2008 8:55 pm   Post subject: RE:assistance with writing to file

how about
code:

highPlayers (i)," ", highScores (i)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sean




PostPosted: Wed Jan 16, 2008 8:58 pm   Post subject: Re: assistance with writing to file

Turing:

highPlayers (i)," ", highScores (i)


Tony gave the proper way, before I could, but the " ", just shows that you want a space, it's like a character, your putting it into the program, but not having anything appear.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: