View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Extract paragraphs from text file

I see that the ReadTextFile function is assigned TWO different
values.

First, it is assigned Space$(LOF(iNum))
And then is assigned Input(LOF(iNum), iNum)

I thought a function was supposed to exit once it is assigned
a value?


I've never heard of such a rule. Who made this one up?

Is it possible to assign a function a value like that?
Twice in succession??


Obviously, yes it is! The 1st assignment sets the buffer size to match
LOF. The 2nd assignment loads the file.

The long coding method would be to dim a string var and use that for
the 2 assignments, then assign it to the function. I just don't see the
point in the extraneous coding!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion