>John,
>
>If you want the other object to become a contained member object of the form use the form.AddObject() method.
>
>set classlib to myclasses additive
>this.AddObject( "MyContractsLetters", "MyContractLetters" )
>this.MyContractsLetters.umnb1()
>
>When the form destructs the other object will also destruct. Or if you only need the object for a short time you can use the RemoveObject() method to get rid of it earlier.
>
>If you use CreateObject() you are creating the object bound to a memvar that will go out of scope when the method ends and thus the object will destruct. You'd need to create a PUBLIC scope memvar to prevent that.
>
>>I have a form that needs to execute code in a class that isn't part of the form, but I can't get it working.
>>
>>In the forms init I say:
>>
>>set classlib to myclasses
>>createobject("mycontractsletters")
>>
>>To call one of the methods of the class called mycontractsletters
>>I am doing this:
>>
>>THISFORM.mycontractsletters.umnb1() && umnb1 is method I need call
>>
>>I am getting mycontractsletters is not an object. Obviously I'm not doing this correctly, but what is the best way to do this?
>>
>>Thanks!
>>
>>John.
David,
Thanks for the tip. I think the addobject method sounds like a better way to go on this. No need to worry about memvars! thanks.
John.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only