Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One exit per procedure/function/codeblock to what purpos
Message
From
07/10/2003 01:59:39
 
 
To
06/10/2003 18:30:53
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00835552
Message ID:
00835630
Views:
10
Hello, Mike

I completely agree with the quoted piece of code. One single modification in my case: Especially in data-entry forms, where many fields are involved in validation, the code looks like:
IF NOT frmbizobj.DataValidation()
RETURN
ENDIF

*!* The rest of the code here
and the frmbizobj.datavalidation looks like your code:
IF NOT condition
* some messagebox here, set the focus to the problematic field
RETURN .F.
ENDIF

IF NOT other_condition
* some other messagebox here, set the focus
RETURN .F.
ENDIF

and so on, till the last validated field.
>I'd agree with this as a standard.
>
>
LPARAMETERS tcParm1
>IF VARTYPE(m.tcParm1)#"C"
>  RETURN .F.
>ENDIF
>
>IF NOT SOMETHING
>  RETURN .F.
>ENDIF
>
>LOCAL llOK
>llOK = .T.
>
>LOCAL m.loSetTalk
>m.loSetTalk = CreateObject("SETTALK")
>
>SET TALK ON
>REPLACE FIELD WITH "VALUE" FOR Condition = .T.
>RELEASE m.loSetTalk
>RETURN m.llOK
>
>
Grigore Dolghin
Class Software.
Previous
Reply
Map
View

Click here to load this message in the networking platform