Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
READ TIMEOUT has incorrect timing
Message
De
27/03/2013 08:25:28
 
 
À
25/03/2013 15:04:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01569181
Message ID:
01569334
Vues:
122
As I said, it's legacy code. A rewrite is an option, sure. But it's in this case only an option if there's an urgent reason to do so. It might well be that here we have that reason. :)

>If you have access to the source code, you could try a workaround. After the ACTIVATE WINDOW MsgBox line, add the code:
>
_screen.forms(1).AddObject("tmrAutoClose", "myTimer", tnTimeout)
>
>And then have a myTimer class defined which is something like (untested):
>
DEFINE CLASS myTimer AS Timer
>    PROCEDURE Init
>    LPARAMETERS tnTimeout
>        this.Interval = tnTimeout * 1000
>
>    PROCEDURE Timer
>        this.Enabled = .f.
>        KEYBOARD '{Escape}'
>ENDDEFINE
>
>
>If something like this works, then you could write a little parser tool which reads in your .SPR files, and inserts that code appropriately for compilation in the Visual FoxPro version.
>
>
>
>
>>Here is some code derived from legacy code. The TIMEOUT clause does not cause a time out after the specified number of seconds. Is this a known bug?
>>
>>
local t, ln
>>for ln = 1 to 6
>>	t = seconds()
>>	msgbox( "hello", m.ln * 10 )
>>	? m.ln, seconds()-t
>>next
>>
>>FUNCTION MsgBox
>>	PARAMETER m.tcMsg, tnTimeout
>>
>>	local lnChoice, lcMsg
>>	
>>	lnChoice = 0
>>	
>>	lcMsg = m.tcMsg + "  (This message should disappear after " + ltrim( str( m.tnTimeout ) ) + " seconds of complete inactivity.)"
>>	
>>	DEFINE WINDOW MsgBox AT 0,0 SIZE 10, 100 SYSTEM FLOAT SHADOW TITLE "msgbox"
>>		
>>	ACTIVATE WINDOW MsgBox NOSHOW
>>
>>	@  2,  2 say m.lcMsg
>>	@ 10, 50 GET m.lnChoice FUNCTION '*H'
>>			
>>	ACTIVATE WINDOW MsgBox
>>
>>	READ CYCLE MODAL TIMEOUT m.tnTimeout
>>
>>	RELEASE WINDOW MsgBox
>>
>>	RETURN
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform