Reading a (BIG) text file one line at a time - in reality...

Richard Gaskin ambassador at fourthworld.com
Wed Nov 24 04:54:27 CST 2004


xbury.cs at clearstream.com wrote:
>>Maybe such a handler could look like this:
>>
>>ReadBuffered pFileName, pChunkType, pCallbackMessage, pBufferSize
>>
>>Your routine calls ReadBuffered and the ReadBuffered command sends the
>>callback message to you with the next chunk as its param.
>>
>>Here's a challenge:  can we implement callbacks in a way that don't use
>>"send"? It's not prohibitively slow, but if we're doing this for speed
>>it'd be nice if we could add the convenience of a separate handler
>>without sacrificing any milliseconds we don't need to.
> 
> 
> I would definitely try to avoid sending the data. 
> 
> A referenced variable (oops, @ not in the docs keywords index)
> would be great or a temp global space would save a lot of passing data 
> around.
> 
> just consiwondering

I think that's a wise move:  better for performance, leaner on memory -- 
the two reasons for doing a buffered read in in the first place. :)

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list