Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Properties 'Exit' is not found 1

Status
Not open for further replies.

sohrab100

Programmer
Jan 18, 2002
56
0
0
HK

Description: Exit is a UserDefine Method in a Form

My Code

On key label f2 _screen.activeform.exit

Sometime, my client report that they face "Properties 'Exit' is not found", it is related to "EXIT" is a reserved word?
So are there any difference with the command below:

On key label f2 _screen.activeform.exit()

Since Book Tell me no need to include bracket.




sohrab100
 
Mike Gagnon,

Use the [ i g n o r e] tags (no spaces).


That was what I was trying to do. I wrote the following, without the spaces:

[ i g n o r e] [ i g n o r e] [/ i g n o r e]

and it somehow produced that y-umlaut. Weird.

But I like your idea better -- add the spaces to confound the TGML processor.

Mike


Mike Lewis
Edinburgh, Scotland
 
sohrab100,

You have just described a common problem associated with the Activate event. It even happens when you swith between the main VFP window and the Debugger, which is understandable but it makes debugging Activate events a bit tricky.

How about adding this to your code:

IF _SCREEN.Formcount > 0
_SCREEN.AciveForm.Exit
ENDIF

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi Ramani,

While we're on the topic of NODEFAULT and DODEFAULT(), I thought I should also clarify for any readers out there that they are not opposites!

The first thing to realize is that there are two types of behavior for any given method. First is the native behavior. In the case of the keypress event of a textbox, the native behavior is to display the character you type. Second is the behavior you have coded. That could be in your base class or any class down the class hierarchy.

When you type code into a method, you are overriding any code you have in the class hierarchy, unless you have DODEFAULT(). The DODEFAULT() tells VFP to run the code you have in the parent class(es) at that point. The native behavior will still run in either case.

NODEFAULT is what you use when you want to tell VFP not to perform the native behavior.

An example of how these interact would be the case of a textbox, where you have special code in the keypress method. If you create a subclass of this textbox, and want to add to the keypress code, you would need to add a DODEFAULT() to run the code you have in the parent method. But if you don't want the textbox to display the characters typed, you would also need a NODEFAULT.



-BP
 
Ramani, the ThisForm.WIndowState = 1 do not work.
e.g Form1--Call (Modal)-->Form2--Call (Modal)-->Form3

Search Form is Form1
Main Form is Form2
Addition Info Form is Form3
Form2 LostFocus: ThisForm.WIndowState = 1
Form2 GotFocus: ThisForm.WIndowState = 2


if I do "ThisForm.WIndowState = 1" in Form2, when i call Form3, Form2 mininize and Form1 & Form3 Show, when Form3 close, Form1 will on top of Form2 which is invalid sequence.



sohrab100
 
Mike, what do u think i should insert the code in Form1, Form2 or Form3? and what event should be?

IF _SCREEN.Formcount > 0
_SCREEN.AciveForm.Exit
ENDIF

Will it exit my form1 and lost the modal sequence and produce big problem?

sohrab100
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top