View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Conan Kelly Conan Kelly is offline
external usenet poster
 
Posts: 419
Default Move/reset to the beginning of a TextStream

Hello all,

I'm storing values in a string array. I need to loop through a TextStream
for each element in the array.


Dim ptstSource As TextStream
Dim pstrMEDates() As String
Dim pbytArrayElements As Byte

... 'pstrMEDates() gets ReDim'ed along the way
...

For pbytMEDatesIndex = LBound(pstrMEDates) To UBound(pstrMEDates)
Do While Not ptstSource.AtEndOfStream
...
...
Loop
Next pbytMEDatesIndex

After running through the TextStream for the first element,
ptstSource.AtEndOfStream will be true, correct? It doesn't look like there
are any methods for the TextStream object to move to the beginning of the
stream.

I'm guessing that my only option would be to close the TextStream, then
re-open it. Is that correct?

Thanks for any help anyone can provide,

Conan Kelly



---------------------------
"Smokin' weed kills your brain cells. Drinkin' only screws up your
liver...ya got 2 a those."
- Earl Hickey (NBC's "My Name is Earl")