Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with timer control
Message
De
05/04/2004 02:48:20
 
 
À
05/04/2004 02:43:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00892170
Message ID:
00892171
Vues:
18
Tariq. Your timer interval is 1 sec. That means *every* 1 sec the event will fire. In the timer event code disable the timer and process your select statement. Then somewhere else depending on your requirements you could re-enable the timer if you need it to be enabled.

btw - Why are you using a timer? Do you want the timer code to execute at regular intervals or only once when the form loads?


>Dear Sir,
>
>I have a form and a dbf. On form there are some textboxes and a timer control.
>The timer interval is 1000. The timer event has following codes
>Form can be download by: http://www.foxite.com/uploads/_7g0ijw2b.zip
>
>*--------------------
>SET SAFE OFF
>SET DATE TO BRITISH
>
>AJK11=DATE()
>AJK12=MONTH(DATE()) && month
>AJK13=DTOC(DATE())
>AJK14=SUBSTR(AJK13,1,2)
>AJK15=VAL(AJK14)
>AJK16=INT(AJK15) && date
>
>SELECT SUNS
>SELECT * FROM SUNS WHERE MONTH=AJK12 AND DATE=AJK16 INTO CURSOR SXK
>
>SELECT SXK
>AJK17=TALOO
>AJK18=GROOB
>
>AJK25=SUBSTR(AJK18,1,2) && hours
>AJK26=SUBSTR(AJK18,6,7) && minutes
>
>STORE (VAL(AJK25)*60*60)+(VAL(AJK26)*60)TO NSECONDS
>NSECONDS1=NSECONDS+43200
>
>AJK27= ALLTRIM(STR(HOUR(DATETIME( ))))
>AJK28=ALLTRIM(STR(MINUTE(DATETIME())))
>
>STORE (VAL(AJK27)*60*60)+(VAL(AJK28)*60)TO NSECONDS2
>
>AJK29=NSECONDS1-NSECONDS2
>
>THISFORM.TEXT15.VALUE= PADL( INT(( AJK29 % 86400 ) / 3600 ), 2, '0' );
> +SPACE(1)+ALLTRIM('-')+SPACE(1) ;
> + PADL( INT(( AJK29 % 3600 ) / 60 ), 2, '0')
>*--------------------
>When form loads, the cursor goes to text1, when I try to write anything in the texthbox the cursor automatically,every time, goes to the beginning of the textbox.
>
>In other case If I set the timer interval to 0 then every thing works fine. What is casuse? Why I could not write into textbox1.
>
>Please help
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform