Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50 - How do you call a CLASS with PARAMETERS on the
Message
From
28/04/1997 12:26:41
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
 
 
To
28/04/1997 11:21:01
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00028751
Message ID:
00029933
Views:
36
>>>
>>> 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...
Previous
Reply
Map
View

Click here to load this message in the networking platform