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

Username:   Password: 
 RegisterRegister   
 how do I save records to disk??
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanShadow




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: 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.
DanShadow




PostPosted: 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]
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: