Making "read from file" less blocky.
Dar Scott Consulting
dsc at swcp.com
Sat Aug 3 22:08:45 EDT 2019
Alas, only read from socket allows a message to be sent upon completion. The step siblings read from file, read from process and read from driver do not.
Here are a few things you might do:
1. Try making the file loading very fast and don't do it in the background. Change the cursor if need be. Try using URL with file: or binfile:, maybe that is fast.
2. Use a "send loop" to read in portions and update a progress bar. You can get help here on how to do that.
3. Process the file lazily and bring in parts as needed.
4. Figure out how to make the file read through networking. Somehow. Maybe.
> On Aug 3, 2019, at 6:56 PM, Tom Glod via use-livecode <use-livecode at lists.runrev.com> wrote:
> Hey folks,
> I'm having trouble finding a combination of settings that allows my file
> loading to seem to happen in the background.
> repeat while read_result is not "eof"
> read from file ThisFile for (1024 * 1000) bytes
> put the result into read_result
> put it after IntoThisVariable
> add length(it) to amount_read
> TSTProgress amount_read,ExpectedSize,"%","Loading File ..."
> (Progress Indicator Handler)
> wait 10 milliseconds with messages
> end repeat
> no matter what I try, its still sluggish, and it seems like messages are
> still accumilating instead of being processed by the engine.
> Am I missing something? Normally waiting with messages sufficiently frees
> the engine to allow the UI to remain responsive.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode