home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7489 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.6 KB  |  43 lines

  1. Newsgroups: comp.lang.pascal
  2. 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
  3. From: SKLEPZI@SSB1.SAFF.UTAH.EDU (Steven Klepzig)
  4. Subject: Re: Wanted: Code for sorting a file
  5. Message-ID: <SKLEPZI.16.0@SSB1.SAFF.UTAH.EDU>
  6. Lines: 31
  7. Sender: news@fcom.cc.utah.edu
  8. Organization: University of Utah
  9. References: <1992Dec15.135354.10665@htsa.aha.nl> <dmurdoch.364.724437122@mast.queensu.ca>
  10. Date: Tue, 15 Dec 92 17:19:51 GMT
  11.  
  12. In article <1992Dec15.135354.10665@htsa.aha.nl> quintenu@htsa.aha.nl (
  13. Quinten Uijldert) writes:
  14. >Who can E-Mail me some code for sorting a file. The file contains
  15. >records like this:
  16. >TYPE
  17. >  RecType = RECORD
  18. >    Name, Street, Zip, Telephone: String;
  19. >  END;
  20. >  FileType = TEXT;
  21. >
  22. >VAR
  23. >  Rec: RecType;
  24. >  f: FileType;
  25. >
  26. >I Want to sort the file on Rec.Name, but I can't figure it out how
  27. >to do it.
  28. >I Use TP 6.0.
  29.  
  30. If the entire file can fit in memory consider creating a linked list in 
  31. memory of the records and do an insertion sort while reading records.  
  32. Sorting to disk can get messy, if you have the older Turbo Access programs 
  33. you could use the Sort program included with it.
  34.  
  35. Also in "Turbo Pascal 6.0 Techniques and Utilities" (ISBN 1-56276-010-6)
  36. there are some code portions for extending filepos, filesize, and seek to 
  37. text files, using DOS funtion 42h.  However, the copyright on the book 
  38. prohibits me from posting the source for these funtions without permission 
  39. and I don't have permission from Ziff-Davis Press.
  40.  
  41. HTH...
  42. Steven (sklepzi@ssb1.saff.utah.edu)
  43.