<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff size=2>Given
that some of us (myself included) don't read files in very often I put together
a simple class to read/write text files so I don't have to look up the how to
over and over again. Given that, reading a file is as simple
as:</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2>set oFile = new
cFileReader<BR>oFile.OpenForRead("c:\test.txt")</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff size=2><BR>Do
While Not oFile.fEof</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff size=2>
Debug.Print oFile.ReadLine</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2>Loop</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2>oFile.closefile</FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff size=2><SPAN
class=860180015-31072003><FONT face=Arial color=#0000ff size=2>'results in debug
window:<BR>'test,hi,bye<BR>'test2,hi2,bye2<BR></FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=860180015-31072003><FONT face=Arial color=#0000ff
size=2>Eliminates the confusion of determining the open mode or choosing Print
vs. Write vs Input (or Get or Put).</FONT></SPAN></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=860180015-31072003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=860180015-31072003>J</SPAN>im
DeMarco</FONT></FONT> <BR><FONT face=Arial size=2>Director of Product Development</FONT> <BR><FONT face=Arial size=2>HealthSource/Hudson Health
Plan</FONT> </DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Brett Barabash
[mailto:BBarabash@tappeconstruction.com]<BR><B>Sent:</B> Thursday, July 31,
2003 10:08 AM<BR><B>To:</B> 'Access Developers discussion and problem
solving'<BR><B>Subject:</B> RE: [AccessD] HTML Email from Access -
Progress<BR><BR></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>With
all due respect to the OO community, does this really warrant a special text
file reader class?</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>I
was thinking of something along the lines of:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Dim
lngIn As Long</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Dim
lngOut As Long</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Dim
strBuffer As String</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003>lngIn = FreeFile</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Open
"c:\input.html" For Input As lngIn</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003>lngOut = FreeFile</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Open
"c:\output.html" For Output As lngOut</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=993430314-31072003>Do
Until EOF(lngIn)</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003> Line Input #lngIn,
strBuffer</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003> 'Insert any string replacement
code here</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003> Print #lngOut,
strBuffer</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003>Loop</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003>Close #lngIn</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=993430314-31072003>Close #lngOut</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=247493201-31072003><FONT face=Arial color=#0000ff
size=2>WIth much deference &c. in the absence of JC I shall propose
writing (or borrowing) a class :-) There's a lovely text file reader class
in ADH2K for reading text files. You can also do it by hand with a little
less work, but once you've got the class installed it's a piece of cake. Do
yoiu have ADH?</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=247493201-31072003><FONT face=Arial color=#0000ff
size=2>Arthur</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com] <B>On Behalf Of </B>Steve
Capistrant<BR><B>Sent:</B> July 30, 2003 4:43 PM<BR><B>To:</B> Access Developers discussion and problem solving<BR><B>Subject:</B> RE: [AccessD]
HTML Email from Access - Progress<BR><BR></FONT></DIV>
<DIV><SPAN class=899184220-30072003><FONT face=Arial color=#0000ff
size=2>Andy,</FONT></SPAN></DIV>
<DIV><SPAN class=899184220-30072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899184220-30072003><FONT face=Arial color=#0000ff
size=2>Can you explain just a little more specifics on how you did this: "....Just read it in line by line and built up a
string...."</FONT></SPAN></DIV>
<DIV><SPAN class=899184220-30072003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899184220-30072003></SPAN><FONT face=Arial color=#0000ff
size=2><SPAN class=899184220-30072003>Thanks,</SPAN></FONT></DIV>
<P><FONT size=2>Steve Capistrant<BR></FONT></P>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px"><FONT
face=Arial color=#0000ff
size=2></FONT> </BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><BR><BR>--------------------------------------------------------------------------------------------------------------------<BR>This
email and any files transmitted with it are confidential and<BR>intended solely for the use of the individual or entity to whom<BR>they are
addressed.<BR>If you have received this email in error please notify
the<BR>originator of the message. This footer also confirms that this<BR>email
message has been scanned for the presence of computer viruses.<BR><BR>Any views expressed in this message are those of the individual<BR>sender, except
where the sender specifies and with authority,<BR>states them to be the views
of Tappe Construction Co.<BR><BR>Scanning of this message and addition of this
footer is performed<BR>by SurfControl E-mail Filter software in conjunction
with <BR>virus detection software.<BR></BLOCKQUOTE><FONT SIZE=3><BR>
<BR>
***********************************************************************************<BR>
"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message. Thank You".<BR>
***********************************************************************************<BR>
</FONT>
</BODY></HTML>