I have a very simple parameter class that I use with forms, mostly because I often want more than one variable returned. The parameter class has one property, an array and the the init method redimensions the array.
I create it like this:
ox = CreateObject("cParams", 4)
which means I now have in ox
ox.parms[1]
ox.parms[2] etc.
I then call forms with:
DO myform with ox
In the init of myform:
LPARAMETER toParms
*-- in order to keep a reference to toParms available:
thisform.oparms = toParms
In the code, I will populate thisform.toParms.parms[1] - [4] as necessary
Then in the destroy:
thisform.toParms = NULL
*-- this removes the reference to the object so the form can properly close.
*-- but since ox still exists in the calling method and since thisform.toParms
*-- was just a reference to ox, ox now has the values from the form.
That's it!
>I know you can do something like
>do form to myvariable
>
>Is there a similar way to get a variable from the object as it is released?
>
>obj=createobject("objtomake")
> then when the object is released some variable is set.
>i.e.
>in the release event
>return obj.RetVal would place the value of obj.retval someplace
>
>TIA,
>Mike
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement