Putting multiple variables into a text file
Author |
Message |
S_Grimm
![](http://compsci.ca/v3/uploads/user_avatars/18926424384e6d86e5cf4d6.jpg)
|
Posted: 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
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
btiffin
![](http://compsci.ca/v3/uploads/user_avatars/189169540547b535e50e4a7.jpg)
|
|
|
|
![](images/spacer.gif) |
S_Grimm
![](http://compsci.ca/v3/uploads/user_avatars/18926424384e6d86e5cf4d6.jpg)
|
Posted: Thu Jun 12, 2008 1:15 pm Post subject: RE:Putting multiple variables into a text file |
|
|
thx. it worked |
|
|
|
|
![](images/spacer.gif) |
|
|