I use the Troi-Dialog-plugin for this:
Dial_DelayTicks( "" ; ticks ) where 1 tick = 1/60 of a second so 0,01 second is not possible, one tick would be approx. 0,017 seconds
but if you not allready use that plugin, it may be a bit over the top just to buy a license for this function.
As an alternative you could use the MonkeyBread-Software MBS-plugin which has:
MBS( "Time.Sleep"; duration ) duration is given in milliseconds
Perhaps instead of a pause, you can get the result you want with just a Refresh Window step to make FileMaker pause and redraw the current screen.
Thanks Phil and Menno for your reply,
I just tried Refresh window, that is a whole lot better. It would be nice to have a solution in between. No refresh window is way to fast, use "Pause - Resume" is far to slow, refresh window comes close. Just a little faster then refresh window would be nice.
I also have a look at the MBS plugin.
Maybe if you combined your Loop with a Refresh Window just before or after the loop code....
I tried both, the "refresh window" within the loop works best, because the user can see what is happening. It is working well. The only thing is (not a major issue) that a little faster would be nice. In this case I have to cycle threw 850 records.
I also tried "refresh object" in the loop, but that doesn't seem to work. Also my script using the Get (CurrentTimeUTCMilliseconds) doesn't seem to work within the loop. Are there functions not working within a loop?
What I was suggesting would look something like this:
Set Variable [ $Time; Value: ( (GetAsNumber ( Get(CurrentTimeUTCMilliseconds)) ]
Exit Loop if [ GetAsNumber ( Get ( CurrentTimeUTCMilliseconds)) > $Time + 400
You might also try moving the refresh window up to be just above the inner loop instead of just below it.
How about not using a time-based system at all but rather an "pass-based" system. Activate your Refresh Window step every 10 passes, rather than every pass.
Drop the nested loop. In your main loop do this:
Set Variable [$counter ; 1 + $counter ]
If [ $counter = 10 ]
Set Variable ( $counter ; 0 )
I like David's suggestion here.
Phil and David,
Thanks for your suggestion David. It is a very good suggestion.
But what I mend with the "Time Loop" Phil, is that it seems it isn't working at all. I replaced the time loop with your suggestion, a refresh window, and it doesn't make any difference in time when cycling threw the records. I got the feeling that the nested loop with the Get (CurrentTimeUTCMilliseconds isn't working at all.
But I will implement David's suggestion.
Both thanks for your patience and time.
This thread begs the question. Why would you want the user to "know something is happening"?
Long running scripts often leave the user time to worry that things have somehow "broken". Providing some sort of visual feedback to the user that all is working as expected helps re-assure them and if it is sufficiently informative--such as a progress bar type display, can give them a good idea if they have time to hit the head or get a fresh cup of coffee.
I recall back in FileMaker 3 days, setting up a layout with a massive large number in a field that represented the current found set. Since the looping script found all unprocessed records, Isolated a sub set with a common value, processed them, marked them as "processed", then looped back to find all unprocessed records, this large number started out with a value of several thousand and gradually updated to smaller and smaller values until done....
Recently, I saw a nice trick done where they displayed an animated gif in a web viewer while the script was running and then dismissed the small window with that web viewer when finished as a way to provide visual feedback, but without any kind of "progress" shown.
You are exactly right Phil,
In my case I use a simple progress indicator, so the user is informed the software is working as expected. If I don't show anything, the user starts clicking buttons while the system is doing something else.
I set the counter on "3"
Works smoothly, perfect.