Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nodefault & QueryUnload
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Nodefault & QueryUnload
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01027711
Message ID:
01027711
Views:
56
Hi everybody,

I'm confused. I need someone to explain me what exactly is happenning when there is a NODEFAULT in the code.

I subclassed a form. I put the following code in the QueryUnload:
*---------------------- Location Section ------------------------
*   Library: 	Aforms.vcx
*   Class: 		Dataentryform
*   Method: 	Queryunload()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	06/07/2005 - WGB
*		MODIFIED
*----------------------------------------------------------------
LOCAL llReturn
thisform.lIsClosing = .t.
if type('THISFORM.ActiveControl') = 'O' and not ;
		isnull(thisform.activecontrol) and PEMSTATUS(thisform.activecontrol,'valid',5) ;
		and inlist(lower(thisform.activecontrol.baseclass),'textbox','editbox')
	thisform.activecontrol.valid()
endif

llReturn =  dodefault()

thisform.lIsClosing = .f.

RETURN m.llReturn
In the baseform QueryUnload there is a nodefault if the user answers Cancel:
*---------------------------------------
		*--- Ask if they want to save changes
		*---------------------------------------
		lnReply = This.AskToSave()
	   IF lnReply = IDCANCEL OR lnReply = IDMUSTKEY
	   	*-------------------------------------------
	   	*--- Reset the nGoToPageOnCancel property
	   	*--- if it has been changed.
	   	*-------------------------------------------
			IF lnGoToPageOnCancel != 0
		   	This.nGoToPageOnCancel = lnGoToPageOnCancel
		   ENDIF
			NODEFAULT
			RETURN .F.
		ENDIF
How my code is going to work with the original code? Is my code OK?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform