There's a third way, assign values to the object properties.
loForm = CreateObject('MyClass')
loForm.Prop1 = Val1
loForm.Prop2 = Val2
....
>>how do you Pass a parameter or reference a variable when defining a class.
>
>Basically, you can pass a parameter two ways (apart from a few workarounds, like public or private variables):
>
>1) Pass the parameter when you create the object:
>
>
>CreateObject('MyFormClass', par1, par2)
>
>
>Parameters have to be accepted (and copied to properties) in your Class's Init().
>
>2) CreateObject(), without additional parameters, and then call a custom method to pass information.
>
>
>loForm = CreateObject('MyClass')
>loForm.SetValues(par1, par2)
>
>
>>
>>I am trying to Create a form with the controls on fly by using an array. and creating the command buttons and procedures using a loop. Problem is I cannot get this to work.
>>
>>sample code.
< snap >
--sb--