how do I save records to disk??
Author |
Message |
DanShadow
![](http://compsci.ca/v3/uploads/user_avatars/12142970654c996e83e6997.png)
|
Posted: Sat Jan 24, 2004 8:58 pm Post subject: how do I save records to disk?? |
|
|
Im making an application which is essentially a Forum...for users on one login account. Now my problem is, ive created a record called "Forum"...then an array "inputForum: array 1..100 of forum"...and cannot save the record.. can you please help>???
code: |
type Forum :
record
sender : string
subject : string
text : string
datewritten : string
end record
var inputForum : array 1 .. 100 of Forum
var datafile : int
for i : 1 .. 100
inputForum (1).sender := "Dan"
inputForum (1).subject := "My New Computer Forum!"
inputForum (1).text := "Well, as you can see, I now have coded my own forum, which supports multiple users over 1 computer to send messages to eachother! Enjoy!"
inputForum (1).datewritten := Time.Date
inputForum (1).sender := ""
inputForum (1).subject := ""
inputForum (1).text := ""
inputForum (1).datewritten := ""
end for
open : datafile, "Forum", put
for i : 1 .. 100
put : datafile, inputForum (i)
end for
close : datafile
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Sat Jan 24, 2004 9:37 pm Post subject: (No subject) |
|
|
You need to specify the exact element of "forum" to be written.
I.e.
put : file, forum(i).sender
etc etc. |
|
|
|
|
![](images/spacer.gif) |
DanShadow
![](http://compsci.ca/v3/uploads/user_avatars/12142970654c996e83e6997.png)
|
Posted: Sat Jan 24, 2004 9:50 pm Post subject: (No subject) |
|
|
yay! thanks a lot man! Here, have a a little bi ts
[+5 bits] |
|
|
|
|
![](images/spacer.gif) |
|
|