home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3588 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.6 KB  |  32 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!bnrgate!nott!cu23.crl.aecl.ca!wl.aecl.ca!stebnerd
  3. From: stebnerd@wl.aecl.ca
  4. Subject: VB: Reading a file using a TYPE-defined variable
  5. Message-ID: <20NOV92.20594183@wl.aecl.ca>
  6. Sender: news@cu23.crl.aecl.ca (USENET News System)
  7. Nntp-Posting-Host: wc4.wl.aecl.ca
  8. Organization: AECL RESEARCH
  9. Date: Sat, 21 Nov 1992 02:59:41 GMT
  10. Lines: 20
  11.  
  12.   I've got a formatted file and I would like to open it as random access and
  13. use a TYPE defined variable to read in a complete record at a time.  My
  14. problem is that the first field of each record is a string (constant length);
  15. the rest are all single precision.
  16.   It seems that VB likes to automatically carriage return and line feed right
  17. after reading a string and then continues as per usual - until it reads another
  18. string.  This screws things up ROYALLY (so to speak).  Is there anyway to
  19. override this ridiculous built in CR & LF?
  20.   The only way I've been able to get around this problem is by reading an
  21. entire record at once using LINE INPUT#, parsing it into substrings (this is
  22. easy because the file is formatted), and finally using VAL to assign the
  23. substring values to the SINGLE variables.  This involves 3 brutally slow steps
  24. when it *should* be easy to accomplish this with only 1!!  This just isn't
  25. going to work efficiently for large files.
  26.   Has anyone got any better suggestions? (oh please, oh please, oh please...)
  27.  
  28.   Thanks A LOT in advance!
  29.  
  30. -Daren Stebner
  31. stebnerd@wl.aecl.ca
  32.