Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A real Timer
Message
De
03/09/1997 07:00:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00048038
Message ID:
00048223
Vues:
26
Hi Biju!

I used the techniqe, as follows:
I have a thermometer screen. On this there are two objects. A textbox, which is the real thermometer, and a picture, which is an indicator, that program works (working bitmap), because during long SQL select thermometer is rare updated. I tested different ways, and Timer proc only updates the working bitmaps. For thermometer updates, first I wrote an FLL function but it wasnot as fast as the following:

nMax=recno()
oBox=fThermometerform.textbox
nLengthOfThermometer=35 && char
nCallPerChar=nMax/nLengthOfThermometer
select *, iif(len(oBox.value) UpdateThermometer(m.obox),.f.) ;
....

UpdateThermometer is a normal UDF, I wrote it in FLL but wasnot faster.
If I leave out the int function the processtime gets 3-4 times Slower.
nCallPerChar determines, how often Select call UpdateThermometer function.
I saw other solutions, but if the udpating condition was in the udpate function the Select statement gets much slower. First I used it too, but even it was written in C in an FLL, it was slower, than this type of updating.
So back to the timer, in the Init event of thermometer form, the timer is started. And in the Unload Event timer is stopped. At timer events, the bitmap is refressed. I used the MOON states (from VFP samples) to indicate for user that program works.
The timer at any events, not only NullEvents checks the elapsed time, and if the condition true (acttime>lasttime+duration) fires the method, which name was given at init. Time testing at any VFP event doesnot affect VFP performance more than 2%. (measuring the different Select times.)
The problem was, that even creating a Windows system Timer Callback function VFP stops sending messages to event loop, even the Timer Callback function wasnot called during pussing down left mouse button on any VFP window title. (Whitout this Callback function, messages was stopped also during menuactivating and some other user actions.)
I still havent found the all-state-proof solution.

BB





>Hi Bela,
>
>NullEvents fires only when nothing happens.
>This means that the UDF fires only if the user doesn't touch the KB
>or the mouse. Right? What happens if the user runs an SQL and
>keep moving his mouse?
>
>I think u have to update the Thermometer during the normal events
>as well as the NullEvents. (It'll be slower!)
>
>BTW, How do you know in advance when the SQL is gonna complete?
>
>
>HTH,
>Biju
>
>>
>>
>> Hi everybody!
>>
>> I am working on a timer solution. I have found that VFP timer control
>> doesnot get event during long statements like SQL select,
>> and user actions (mousebutton down on window title etc.)
>> I wrote an fll, in which I use the NullEvent to check the elapsed time, and
>> if an interval is over it fires a UDF. (Time resolution 1 sec) It works
>> under normal VFP statements like SQL select (so it is good for animated
>> thermobar bmp-s, which has no affects for the select performance - max 4
>> percent slower). But ...
>> VFP NullEvents doesnot come under some user actions. So, if user push down
>> the mouse button my timer event isnot fired.
>>
>> Has anybody any idea?
>>
>> BB
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform