Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to show thermometer in FPDos 2.6
Message
De
24/02/2006 18:56:51
 
 
À
24/02/2006 08:29:33
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Versions des environnements
Visual FoxPro:
FoxPro Dos
Divers
Thread ID:
01098531
Message ID:
01099109
Vues:
27
>>>Hi,
>>>
>>>Is there a way that FPDos shows a thermometer for long APPENDs and COPY TO? I found out how to SET TALK ON WINDOW for the moment, but a thermometer would be more elegant.
>>
>>One thing you could try would be to include a UDF in a FOR clause in these commands. The UDF would always return .T. (basically a "dummy" function call) but it could do anything else before returning .T. (i.e. updating some sort of thermometer).
COPY TO ... FOR MyUDF()
>>
>>FUNCTION MyUDF
>>
>>* Update the thermometer here
>>
>>RETURN .T.
Of course, the major downside to this approach is that MyUDF() gets executed for each and every record processed so it could really slow things down. You could experiment with passing parameter(s) to MyUDF() that could update the thermometer only on every 100th or 1000th record, or when a new "segment" of your thermometer is completed, for example.
>
>Thank you Al. That would work but I'm afraid of the speed hit since this is already a lenghthy process. I'll stick with SET TALK ON TO WINDOW xxx.

It might actually be easy to determine if it's going to slow you down significantly. During one of your long-running processes, simply look at CPU utilization. If the process uses 100% CPU (i.e. CPU-bound) then yes, all the UDF calls will slow you down (maybe a lot). OTOH if CPU is significantly less than 100% then the operation may be I/O-bound instead, leaving lots of spare CPU to do other stuff (like show a thermometer ;)) In the latter case you may find the slowdown is insignificant or non-existent.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform