Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code Running three times
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01261323
Message ID:
01261355
Vues:
9
>Here's the actual code which gets run. I'll list the places where I had the calling of the code also:
>
>
>* .Validate_Field_Specs()
>WITH ThisForm
>	* Clear out this form-level memory variable.
>	.cAllSpecNotes=""
>	IF !EOF("Specs")
>		.lblSpecsMsg.Visible = .T.
>		.lblSpecsMsg.Caption="Spec Found!"
>		* DIAMETER Validation.
>		.Validate_Diameter()
>		IF !EMPTY(.cDiaSpecNotes)
>			.cAllSpecNotes=.cDiaSpecNotes
>		ENDIF
>		* BREAK Validation.
>		.Validate_Break()
>		IF !EMPTY(.cBreakSpecNotes)
>			.cAllSpecNotes=.cAllSpecNotes + ;
>				CHR(13) + CHR(10) + .cBreakSpecNotes
>		ENDIF
>		* OUT OF ROUND Validation.
>		.Validate_OutOfRound()
>		IF !EMPTY(.cOutOfRoundSpecNotes)
>			.cAllSpecNotes=.cAllSpecNotes + ;
>				CHR(13) + CHR(10) + .cOutOfRoundSpecNotes
>		ENDIF
>		* CAST Validation.
>		.Validate_Cast()
>		IF !EMPTY(.cCastSpecNotes)
>			.cAllSpecNotes=.cAllSpecNotes + ;
>				CHR(13) + CHR(10) + .cCastSpecNotes
>		ENDIF
>		* TENSILE Validation.
>		.Validate_Tensile()
>		IF !EMPTY(.cTensileSpecNotes)
>			.cAllSpecNotes=.cAllSpecNotes + ;
>				CHR(13) + CHR(10) + .cTensileSpecNotes
>		ENDIF
>		* TORSION Validation.
>		.Validate_Torsion()
>		IF !EMPTY(.cTorsionSpecNotes)
>			.cAllSpecNotes=.cAllSpecNotes + ;
>				CHR(13) + CHR(10) + .cTorsionSpecNotes
>		ENDIF
>		IF LEN(ALLTRIM(.cAllSpecNotes)) > 0
>			MESSAGEBOX(.cAllSpecNotes, 0+64, "Out of Spec Notes")
>		ENDIF
>	ELSE
>		.lblSpecsMsg.Caption="Spec NOT Found!"
>		.lblDiaOutOfSpec.Visible    =.F.
>		.lblBreakOutOfSpec.Visible  =.F.
>		.lblRoundOutOfSpec.Visible  =.F.
>		.lblCastOutOfSpec.Visible   =.F.
>		.lblTensileOutOfSpec.Visible=.F.
>		.lblHelixOutOfSpec.Visible  =.F.
>		.lblTorsionOutOfSpec.Visible=.F.
>		.lblBendOutOfSpec.Visible   =.F.
>		.lblWrapOutOfSpec.Visible   =.F.
>	ENDIF
>ENDWITH
>
>
>I call the form-level method in the Form's INIT, in the SAVE button, in the navigational buttons and in the afterrowcolumnchange method in the grid that shows the records.

I don't think you need to call this method from form's Init, you do want to call this method from all other mentioned methods but make sure these buttons (and grid's AfterRowColChange) don't call each other.

Also see Re: Validating data in grid entry Thread #678737 Message #678924 for grid validation.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform