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

Username:   Password: 
 RegisterRegister   
 Putting multiple variables into a text file
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
S_Grimm




PostPosted: Thu Jun 12, 2008 11:27 am   Post subject: Putting multiple variables into a text file

I cannot fogure out how to put multiple names into a text file. here is what i currently have. If anyone has any suggestions, it would be appriciated.


Turing:

var out, students : int
var class1 : array 1 .. 10 of string
var class2 : array 1 .. 10 of string
var class3 : array 1 .. 10 of string
var class4 : array 1 .. 10 of string
var classes : array 1 .. 5 of string := init ("math", "art", "tech", "compsci", "french")
%%%%%%%%%%%%%%%%%%%%%%%%%%

put "How many students are you entering information for? : " ..
get students
var stu : array 1 .. students of string
for i : 1..students
put "Enter name of student : " ..
get stu (i)

put skip
put "Enter the First Class"
get class1 (i)
put "Enter the Second Class"
get class2 (i)
put "Enter the Third Class"
get class3 (i)
put "Enter the Fourth Class"
get class4 (i)

end for

for i : 1..students
var name : string := ("C:\\math.txt")
var file : int
open : file, name, get, put
loop
exit when eof
get : file, *
put : file, stu (i)
end loop
close : file
end for
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: Thu Jun 12, 2008 12:50 pm   Post subject: RE:Putting multiple variables into a text file

Try mod and/or seek on the open.
http://www.holtsoft.com/turing/tech/append.html

I don't really know, not having Turing installed.

Cheers
S_Grimm




PostPosted: Thu Jun 12, 2008 1:15 pm   Post subject: RE:Putting multiple variables into a text file

thx. it worked
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: