Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Classes -Sending Parameters or Using variables
Message
 
 
À
05/11/2001 14:39:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00577526
Message ID:
00577533
Vues:
11
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform