Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clear Events isn't
Message
 
 
À
29/01/2013 13:38:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01564509
Message ID:
01564558
Vues:
43
>>>Hey Guys
>>>
>>>This is an issue I usually don't have a problem with, but here it is
>>>
>>>Application starts,
>>>VFP desktop hidden
>>>Main form fires off
>>>Main form issues Clear Events and closes
>>>
>>>(Update)
>>>After the Clear Events is issued and before the form closes, it goes through the GotFocus of a textbox (the only interactive object on the screen)
>>>
>>>VFP desktop doesn't Clear - get 'cannot close FoxPro' window
>>
>>What does a trace show you. What happens in GotFocus? What code runs after that?
>>
>>Try scattering a bunch of DEBUGOUTs in the code along with turning on the event tracker to see exactly what's happening. If that doesn't give you the necessary clue, try running with coverage on and walk through the coverage log to see exactly what's happening.
>>
>>Tamar
>
>
>I have since removed the code from the GotFocus event after I realized that it was redundant.
>
>Here's the code in question and is in the LostFocus of the TextBox
>
>If QstCnt > TotNum
>  If TestSection = 'L'
>    TestSection = 'R'
>    QstCnt = 1
>    AnsString = ""
>    Thisform.m_getlist
>    If TestSection = 'L'
>      Thisform.Caption = "Listening Tutorial"
>    Else
>      Thisform.Caption = "Reading Tutorial"
>    Endif
>    This.Value = ""
>    Thisform.Refresh()
>  Else
>    =Messagebox("This is the end of the Test", 64)
>    Thisform.r_QuitForm = .T.
>@    Clear Events
>@    Thisform.Release
>@  Endif
>@Else
>  ** Get next question
>
>
>The lines that have the '@' sign are the lines it hits. It returns to the calling program
>
>do form DispQuestions
>read events
>Clear Events
>
>and sits on the read events
>
>Like I said before, I've never had this problem before - and it's a little crazy making, especially since I have a VERY short turnaround on this.

Keep thisform.Release() and move CLEAR EVENTS to the Destroy method of the form. Also, this is the first time I see releasing the form from the LostFocus instead of the button's code.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform