Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - How do you call a CLASS with PARAMETERS on the
Message
De
28/04/1997 12:26:41
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
 
 
À
28/04/1997 11:21:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00028751
Message ID:
00029933
Vues:
34
>>>
>>> I want to call a CLASS with PARAMETERS.
>>> help
>>put the PARAMETERS statement in the init
>>oMyObject = CREATEOBJECT("MyClass", parm1, parm1)
>>
>>BTW, Robert, did your copy of VFP come with a .hlp file? ;-)
>>--
>>Matt McDonnell
>>
>>Conventional Wisdom - "If it ain't broke, don't fix it."
>>Gates Wisdom - "If it doesn't work, sell it, and fix it later."
>
>Could you give me an example of when I would use this?
>>oMyObject = CREATEOBJECT("MyClass", parm1, parm1)

Didn't you start this thread? ;)

CREATEOBJECT allows more efficient use of RAM. You control what objects are loaded when you need them. I use CREATEOBJECT for login forms and forms that may have different looks depending on user input (actually, in that case I use Myform.AddObject [virtually same effect]).

There are probably other good uses, but I can't think of anything off the top of my head. The primary advantage of CREATEOBJECT is being able to create a local variable reference to your object in a method or procedure and it releases itself when the method/procedure is done.

HTH
Matt McDonnell
...building a better mousetrap with moldy cheese...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform