Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wait while stops showing the number
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01676163
Message ID:
01676190
Vues:
56
In some circumstances it may be a good idea to disable the Exit button, like it is done on some websites for instance to avoid posting double transactions. So if that would cause an issue you can disable the exit button during processing.
THISFORM.cmdExit.Enabled = .F.
THISFORM.Draw()
&& Processing
THISFORM.cmdExit.Enabled = .T.
RETURN .T.
>UPDATE 2. It appears that the only time the WAIT messages "freezes" is when I click on Exit button, while the WAIT goes on. The form which starts the report has EXIT button (and CREATE button, along with some choices). So, if I let the report creating run without clicking anything, the WAIT does not freeze. But I show some impatience and attempt to exit the process, by clicking on EXIT button, the screen cursor changes to a small circle and the WAIT freezes. It is not a big deal though.
>UPDATE. I have just tried your approach. And - I regret to say - it works worse than before. Before, when I was showing the progress in Numbers, it would never "freeze" on my computer; only on customers computers.
>Now, when changing the code to your code that shows percentage, it "freezes" on my PC at about 9%. And then the report shows. So, the process continues; it is simply that the message stops at some point.
>Still, thank you for your suggestion.
>
>I personally like to see the number of records processed. But your approach may be better for customers' perception (% vs number). I will try your approach and see how it looks.
>Thank you.
>
>>If the updates are too frequent, the wait window does not paint properly or skips altogether. I recently changed my own wait window for the same reason:
>>
>>
>>select ("sometable")
>>cTotal = str(reccount("sometable"))
>>nTotal = reccount("sometable")
>>iCount = 0
>>go top
>>
>>LOCAL lnPercentage, lnPercentageNew
>>lnPercentage = -1
>>
>>do while !eof()
>>     iCount = iCount + 1
>>
>>     lnPercentageNew = CEILING(100 / m.nTotal * m.iCont)
>>     IF m.lnPercentageNew <> m.lnPercentage
>>          lnPercentage = m.lnPercentageNew
>>          WAIT WINDOW TEXTMERGE("Processed <<m.lnPercentage>> % ...") NOWAIT
>>     ENDIF
>>
>>     *--- something happens to the record in "sometable"
>>     skip in ("sometable")
>>enddo
>>
>>
>>>The code is not called in a function. Here is a simplified version:
>>>
>>>
>>>select ("sometable")
>>>cTotal = str(reccount("sometable"))
>>>iCount = 0
>>>go top
>>>do while !eof()
>>>     iCount = iCount + 1
>>>     wait nowait "Count " + str(iCont) + " of " + cTotal
>>>     *--- something happens to the record in "sometable"
>>>     skip in ("sometable")
>>>enddo
>>>
>>>
>>>
>>>
>>>
>>>>if that code is called in a function from inside the report it should work, as previous one is deleted...
>>>>(of course with a nowait in last line...)
>>>>when / how do you call the Wait Window ?
>>>>
>>>>>I don't think so. I believe that I need DOEVENT or something like that.
>>>>>
>>>>>>Wait Clea
>>>>>>Wait Window Recno()
>>>>>>
>>>>>>intended, as RecCount() should be fix?
>>>>>>
>>>>>>>
>>>>>>>I have a report that, when generated, goes through many records (depending on the customer). To show the customer that the screen is not frozen, I have WAIT message which shows the record count. But sometimes when I run this report - on customer server, after so many records, the WAIT message stops showing the count. I know that the process goes on because after some time, the report appears.
>>>>>>>
>>>>>>>What code can I add to the WAIT - before or after - to make the count appear?
>>>>>>>
>>>>>>>TIA
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform