Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading Files in VB6

0 views
Skip to first unread message

JeanH

unread,
Sep 1, 2009, 12:24:01 AM9/1/09
to
I am trying to read from a file that has a fixed record length of 80
characters followed by a line feed chr(10). Input and InputLine do not
recognize the end of line so I opened it Random and am using GET. I can read
the file fine with GET. The problem is this. Sometimes the file we have to
read has a different record length and I cant figure out how to create a
fixed length buffer at run time. The command Dim Var1 as string * 81 has to
have a constant and the length of the buffer cannot be a variable. I also
cant seem to have a buffer longer than the record length. I thought that if
my buffer was 256 bytes that it wouldn't matter if I was reading an 81
character record or a 100 character record into it, but I was wrong. My
program throws an error if the buffer isn't exactly the same length as the
record. Is there a way to define the record length and buffer length at
runtime? Or better yet, is there a way to detect the LineFeed as the end of
line?

Nobody

unread,
Sep 2, 2009, 9:37:16 PM9/2/09
to
Multiposted and answered in microsoft.public.vb.general.discussion


0 new messages