Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!decwrl!lll-winken!sun-barr!newstop!sun!jasonf From: jasonf@cetemp.Eng.Sun.COM (Jason Freund) Newsgroups: comp.lang.pascal Subject: I/O with complex datastructures Keywords: I/O datastructures save Message-ID: <140232@sun.Eng.Sun.COM> Date: 6 Aug 90 18:20:24 GMT Sender: news@sun.Eng.Sun.COM Lines: 25 I've never dealt with file I/O in Pascal and I have a question about saving a complex datastructure. Basically, I have a single, very complex datastructure that holds just about all of the information in my program. I want to save all of its data into a file so that I can load it back up when the program's user wants to change some info in the database. I was considering C until I learned that to do this, I would have to create my own file format and step through each cell of the structure using getc/putc to rewrite the data each time I wanted to modify it. That would be impractical for the complexity of my data. I was skimming through the Pascal book and it seems like there is some way you can use reset/rewrite to save all data in a datastructure for reading in later. Is that right? Could someone give me a simple example of how to automatically save a piece of complex data (ie. a record w/ 2+ fields, any recursive structures, etc). Are there any limitations/disadvantages to this? Thanks, Jason Freund, Sun Microsystems, jasonf@cetemp.Corp.sun.com <== summer address Deprtmnt of Computer Science, Univ California, Davis. freund@sakura.ucdavis.edu Quantum Link: JasonF5, Compu$erve: 72007,244, 690 Erie Dr, Sunnyvale, CA 94087 ------------------------------------------------------------------------------- STOLEN QUOTES -- Please give the authors credit if you know who they are! "To understand recursion, you need to understand recursion." "Wow! Virtual memory! Now I'm gonna build me a REALLY big ram disk!" "My other computer is a SUN3/50." "E. Pluribus UNIX" -- authors unkown