Try using an object with a property containing your required contents. Example:
loPackage=CreateObject("custom")
loPackage.AddProperty("cName","John Q. Public")
loForm=Create("TestForm", loPackage)
?loPackage.cName
This will work as an object is passed as reference by default. I've used this extensively for multi-document systems.
>Hi all,
>
>I have a form class which is passed a local variable by reference in the init method. This variable specifies the value of a control on the form. I need to set the controlsource of the control to this reference or set the value of this variable when the form is released. Any ideas???
>
>Bare-bones example:
>
>LOCAL lcName
>lcName = "John Q. Public"
>loForm = CREATE("TestForm",@lcName)
>loForm.SHOW()
>?lcName && This has to be the value typed into the form
>
>DEFINE CLASS TestForm AS Form
> ADD OBJECT txt1 AS TextBox
>
> PROCEDURE INIT
> LPARAMETER p1
>
> ** THIS.txt1.CONTROLSOURCE = p1 && this doesn't work
> ** THIS.txt1.VALUE = p1 && sets value of control but user input does not change value of lcName
>
> ENDPROC
>
> PROCEDURE DESTROY
>
> ** lcName = THIS.txt1.VALUE && this obviously won't work - lcName needs to be local to the calling procedure
>
> ENDPROC
>
>ENDDEFINE