reading from a file

John Ridge ridge11103 at btinternet.com
Mon Jun 13 02:55:45 EDT 2005


on 13/6/05 1:38 am,  use-revolution-request at lists.runrev.com wrote :



>I've tried another method that I thought might be faster - instead of
>reading a chunk at a time and popping it into a field on a new card, why not
>gulp the whole file into a variable, then get each item as a chunk?
>
>In fact it's slower. Ah well...
>  
>
That is kind of surprising.
If it's convenient, could you send the two sets of code so I can see
what the differences are, please ?


-- 
Alex Tweedly       http://www.tweedly.net

-- 
Thanks again, Alex - somehow this bit of your message got misplaced by the
digest process. The answer is simple, I think - I only used a single item
delimiter, so I had to count on my fingers to know when the next item was
the first field on the next card. I'm going to take up Dennis Brown's
suggestion and use two delimiters with the "repeat for each" construct and
let the engine do the counting!

This should work - the "line" and "item" delimiters are just two ways of
chopping up text into chunks separated by whatever character you choose. It
might be nice if there were more than two delimiters, but in this case two
is fine - one for the card, one for the fields within the card.

John



More information about the use-livecode mailing list