Dec 19, 2005 #1 manum79 Programmer Dec 14, 2005 6 US i m trying to write a procedure which accepts a form control and a string as the parameters....... but i dont have a clue how to pass a control as a parameter to this procedure plz help thanks manu
i m trying to write a procedure which accepts a form control and a string as the parameters....... but i dont have a clue how to pass a control as a parameter to this procedure plz help thanks manu
Dec 19, 2005 1 #2 Mike Lewis Programmer Jan 10, 2003 17,516 Scotland Manu, What exactly are you trying to achieve? Do you want to pass the control's object reference as a parameter, or what? For example, if the control is called Text1, and it sits directly on the form, you can pass it like this: DO MyProcedure WITH THISFORM.Text1 The procedure would need an LPARAMETERS statement to receive the object reference: PROCEDURE MyProcedure LPARAMETERS oControl ... ... ? oControl.Name ? oControl.Value ... ENDPROC If I have misunderstood the question, perhaps you could clarify. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My sites: Visual FoxPro (www.ml-consult.demon.co.uk) Crystal Reports (www.ml-crystal.com) Upvote 0 Downvote
Manu, What exactly are you trying to achieve? Do you want to pass the control's object reference as a parameter, or what? For example, if the control is called Text1, and it sits directly on the form, you can pass it like this: DO MyProcedure WITH THISFORM.Text1 The procedure would need an LPARAMETERS statement to receive the object reference: PROCEDURE MyProcedure LPARAMETERS oControl ... ... ? oControl.Name ? oControl.Value ... ENDPROC If I have misunderstood the question, perhaps you could clarify. Mike __________________________________ Mike Lewis (Edinburgh, Scotland) My sites: Visual FoxPro (www.ml-consult.demon.co.uk) Crystal Reports (www.ml-crystal.com)