home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!gatech!news.byu.edu!ux1!fcom.cc.utah.edu!calvin.saff.utah.edu!SKLEPZI
- From: SKLEPZI@SSB1.SAFF.UTAH.EDU (Steven Klepzig)
- Subject: Re: Wanted: Code for sorting a file
- Message-ID: <SKLEPZI.16.0@SSB1.SAFF.UTAH.EDU>
- Lines: 31
- Sender: news@fcom.cc.utah.edu
- Organization: University of Utah
- References: <1992Dec15.135354.10665@htsa.aha.nl> <dmurdoch.364.724437122@mast.queensu.ca>
- Date: Tue, 15 Dec 92 17:19:51 GMT
-
- In article <1992Dec15.135354.10665@htsa.aha.nl> quintenu@htsa.aha.nl (
- Quinten Uijldert) writes:
- >Who can E-Mail me some code for sorting a file. The file contains
- >records like this:
- >TYPE
- > RecType = RECORD
- > Name, Street, Zip, Telephone: String;
- > END;
- > FileType = TEXT;
- >
- >VAR
- > Rec: RecType;
- > f: FileType;
- >
- >I Want to sort the file on Rec.Name, but I can't figure it out how
- >to do it.
- >I Use TP 6.0.
-
- If the entire file can fit in memory consider creating a linked list in
- memory of the records and do an insertion sort while reading records.
- Sorting to disk can get messy, if you have the older Turbo Access programs
- you could use the Sort program included with it.
-
- Also in "Turbo Pascal 6.0 Techniques and Utilities" (ISBN 1-56276-010-6)
- there are some code portions for extending filepos, filesize, and seek to
- text files, using DOS funtion 42h. However, the copyright on the book
- prohibits me from posting the source for these funtions without permission
- and I don't have permission from Ziff-Davis Press.
-
- HTH...
- Steven (sklepzi@ssb1.saff.utah.edu)
-