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

Username:   Password: 
 RegisterRegister   
 Help to get a write problem fixed
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
thoughtful




PostPosted: Mon Sep 29, 2003 9:16 pm   Post subject: Help to get a write problem fixed

Ok....here is the code for writing records to a file...which i will use for a porogram..The only problem is that every time i run it, it deletes all the previous information in the text file.
if n e one can help me with this i will be really grateful.

-=code starts here=-

var stream : int
var d_city, a_city : string
var dist : string

open : stream, "database", put
assert stream > 0
loop
put "Airport Database Creator"
put "Please enter the name of departure city or put 'stop' now to Quit "
get d_city : *

exit when d_city = "stop"
put "Please enter the name of arrival city"
get a_city

put "Please enter distance between ", d_city, " and ", a_city, " ."
get dist

put : stream, d_city
put : stream, a_city
put : stream, dist

end loop
close : stream

-=code ends here=-

*it will generate the text file once u run it.
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Mon Sep 29, 2003 10:27 pm   Post subject: (No subject)

yes, it's suppose to delete the file once you output to it new items.

there is a tutorial about this, in the tutorial section, forgot the link, but it should be a sticky.
AsianSensation




PostPosted: Mon Sep 29, 2003 10:30 pm   Post subject: (No subject)

http://www.compsci.ca/v2/viewtopic.php?t=427

here, found it, just go to that link, Blade has written an excellent tutorial.
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: