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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass a form control as a parameter 1

Status
Not open for further replies.

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
 

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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top