Why is Put not Putting?

Randall Lee Reetz randall at randallreetz.com
Mon Aug 17 16:28:41 EDT 2009


put (the number of words in txtToProcess) into TotWrds
put 100 into Batches
put  (round(TotWrds/Batches)) into WrdsPerBatch
repeat with PrcessChunkCnt 1 to (Batches+1)
	put "Now processing word "&((PrcessChunkCnt-1)*WrdsPerBatch) & " to  
" &(PrcessChunkCnt*(WrdsPerBatch) & " of " & TotWrds &"."
	repeat with WrdCnt =  1 to WrdsPerBatch
		if (((PrcessChunkCnt-1)*WrdsPerBatch)+WrdCnt)² TotWrds
		then
          	  -- do something to word (((PrcessChunkCnt-1) 
*WrdsPerBatch)+WrdCnt)
		else
			exit repeat
		end if
	end repeat
end repeat
On Aug 17, 2009, at 11:28 AM, Randall Reetz wrote:

> i'm sure I am not the first to say so, but you are vastly over  
> estimating the sophistication of the interpretor.  It does not  
> forward to predict and then anticipate the intention of your  
> script.  That is the HAL stuff of science fiction (for now).
> If you have two put statements in the same loop, (or any for that  
> matter) you are also vastly underestimating the speed of your  
> processor.  Your screen doesn't even refresh fast enough to capture  
> updates to the message box that quickly.
>
> Try nesting the main repeat loop within another loop and  
> maintaining a counter that determines a set number of updates (say  
> 100) each of which 1/100th of the total number of loops.  Place  
> your progress updater in the outer repeat loop.
>
>
>
> randall
> -----Original Message-----
> From: Gregory Lypny <gregory.lypny at videotron.ca>
> Sent: Monday, August 17, 2009 8:53 AM
> To: Revolution <use-revolution at lists.runrev.com>
> Subject: Why is Put not Putting?
>
> 	Hello everyone,
>
> 	I use the simple handler below to process large amounts of text.
> Because it can take anywhere from a couple of seconds to ten minutes
> to run, I like to know that something is happening, so I put the very
> first statement in the handler, "Preparing for search..." which is
> supposed to appear in field "Info 1" to let me know that the thing has
> started.  The trouble is, that little progress message never appears,
> but the last statement in the handler, "Processing time and...,"
> does.  This suggests to me that Rev reads ahead through the handler,
> and if it is overwhelmed by a task, such as getting a big data field,
> then it cannot update the screen according to statements that came
> before.  (There are no lock screen statements in the handler.)  How
> can I fix this, so that the statements are executed in the way they
> are meant to be?
>
> 	Regards,
>
> 		Gregory
>
>
> on mouseUp
>
>     put "Preparing for search..." into fld "Info 1" -- This never
> appears in the field!
>
>     set the itemDelimiter to tab
>
>     get fld "Data" of card "Data" -- Lots of data
>
>        repeat for each line thisLine in it
>   	  -- Process the text
>        end repeat
>
>    put "Processing time and [other stats]" into fld "Info 1"
>
> end mouseUp
> _______________________________________________
> 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
>
>
> _______________________________________________
> 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