🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2174

VB: Reading a file using a TYPE-defined variable

#2174
From: stebnerd
Date: Sat, 21 Nov 1992 02:59
20 lines
1627 bytes
  I've got a formatted file and I would like to open it as random access and
use a TYPE defined variable to read in a complete record at a time.  My
problem is that the first field of each record is a string (constant length);
the rest are all single precision.
  It seems that VB likes to automatically carriage return and line feed right
after reading a string and then continues as per usual - until it reads another
string.  This screws things up ROYALLY (so to speak).  Is there anyway to
override this ridiculous built in CR & LF?
  The only way I've been able to get around this problem is by reading an
entire record at once using LINE INPUT#, parsing it into substrings (this is
easy because the file is formatted), and finally using VAL to assign the
substring values to the SINGLE variables.  This involves 3 brutally slow steps
when it *should* be easy to accomplish this with only 1!!  This just isn't
going to work efficiently for large files.
  Has anyone got any better suggestions? (oh please, oh please, oh please...)

  Thanks A LOT in advance!

-Daren Stebner
stebnerd@wl.aecl.ca
Technical Details
Message-ID: <20NOV92.20594183@wl.aecl.ca>
Path: arc1-ca.pugleaf.net!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

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!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
From: stebnerd@wl.aecl.ca
Subject: VB: Reading a file using a TYPE-defined variable
Message-ID: <20NOV92.20594183@wl.aecl.ca>
Sender: news@cu23.crl.aecl.ca (USENET News System)
Nntp-Posting-Host: wc4.wl.aecl.ca
Organization: AECL RESEARCH
Date: Sat, 21 Nov 1992 02:59:41 GMT
Lines: 20