Why no ScreenUp Dates
Mark Smith
lists at futilism.com
Wed Aug 12 05:35:17 EDT 2009
Sivakatirswami , inserting a "wait 0 millisecs with messages" just
after "calcTime" might help.
Sometimes loops are fast enough to get in the way of rendering the
screen, and a 'wait' will give the engine enough time to update the
screen.
Best,
Mark Smith
On 12 Aug 2009, at 03:49, Sivakatirswami wrote:
> I have a little stack that digs some log files.
>
> it works well, but the UI is not updated until the repeat loops and
> handlers are all finished.
>
> It is as if I had a "lock screen" at the start (which I don't) but
> it acts like that.
>
> I have a message that is to be inserted into a field and a timer
> that should update a field on each repeat loop.. But don't see
> anything until it is finished, only then is the GUI is updated.
>
> perhaps the "Read from file" loop is a blocking call?
>
>
> global gStart
> local tPartials,tRevHits,tCompleted
>
>
> on mouseUp
> put empty into fld "Time" # Not happening... blocked
> put empty into fld "output" # Not happening... blocked
> put the uDigging of fld "Status" into fld "Status" # Not
> happening... blocked
> set the cursor to busy
> put 0 into tPartials
> put 0 into tRevHits
> put 0 into tCompleted
> put ticks() into gStart
> repeat for each line y in fld "path"
> put y & cr after tOutput
> open file y for read
> put 20000 into tStep
> put 1000 into tChunkSize
> put 1 & cr into tAccessLogFileChunk
> repeat until tAccessLogFileChunk is empty
> read from file y for tChunkSize lines
> put it into tAccessLogFileChunk
> put processLogs(tAccessLogFileChunk) & cr after tOutput
> calcTime # Not happening... blocked
> end repeat
> close file y
> end repeat
> repeat 5 times
> replace (cr&cr) with cr in tOutput
> end repeat
> put "Summary: " & Cr & "Downloaded with Revolution HT Navigator:
> " & tRevHits & cr into tSummary
> put "Complete Downloads via HT site: " & (tCompleted - tRevHits)
> & cr after tSummary
> put tSummary & cr & "_________________" & cr before tOutput
> # now all fields are updated:
> calcTime
> put tOutput into fld "output"
> put the uFinished of fld "Status" into fld "Status"
> end mouseUp
>
> function processLogs tAccessLogFileChunk
> put empty into tFoundLines
> repeat for each line x in tAccessLogFileChunk
> if x contains fld "SearchString" then
> put x into z
> if z contains "Revolution" then add 1 to tRevHits
> put ("1.1""e&" 200 ") into tCompleteCode
> put ("1.1""e&" 206 ") into tPartialCode
> if z contains tCompleteCode then add 1 to tCompleted
> if z contains tPartialCode then add 1 to tPartials
> put empty into z
> put x & cr after tFoundLInes
> end if
> end repeat
> return tFoundLines
> End processLogs
>
> Stack script has:
>
> global gStart
>
> on openStack
> put the uIntro of fld "Status" into fld "Status"
> end openStack
> on calcTime
> put ticks()-gStart into tTicks
> if tTicks < 60 then
> put tTicks & " ticks" into fld "time"
> else
> put trunc (tTicks/60) into tSeconds
> put trunc(tSeconds/60) & " min. " & ( tSeconds mod 60) & "
> sec." into fld "time"
> end if
> end calcTime
>
>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list