Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MessageBox in a loop!!!!
Message
From
18/10/2001 05:51:04
 
 
To
17/10/2001 23:25:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00570063
Message ID:
00570115
Views:
19
Hi!

MessageBox from a Valid event cause firing of Valid event again. This is because, on the Windows level, it cause deactivating of the main window (and control) and activating of the MessageBox window that is equivalent to losing focus. This cause a lot of Windows events fired for VFP form and as a result - additional call of the Valid event. this additional call is related to the return 0 in the event. Probably you need to restructure code as already suggested by Al Doman.


>Hi Everyone,
>
>Can someone please tell me why in the code below the MessageBox gets caught in a continuous loop. This code is being called in the Valid event of a TextBox. Surely, I'm missing something.
>******************
>local lnanswer
>
>If Empty(This.value)
> lnanswer=messagebox("First Name field cannot be blank",1,"Text Entry Error.")
>Endif
>
>If lnanswer = 2 && If the Cancel button is clicked back out of the record.
> Tablerevert()
> Thisform.flipenable
> Thisform.Refresh
>
>Endif
>
>Return 0
>******************
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform