In an "object oriented" language (such as RealBasic), you can define a
"class", which is like a template for code and data.
To actually make use of the class, you make ("instantiate") an object
according to that class template. When the object is instantiated,
things happen - such as memory allocation for the variables defined for
that object. One of the things that _can_ happen is that you
"constructor" method will be called by the operating system to help
construct (instantiate) the object.
It's usually used to initialize things.
Similarly you can define a "destructor" to tidy up after yourself when
the object is no longer needed.
Most folks who are interested in this "Getting Started" list will not
have any need for either constructors or destructors.
Russ
On Feb 22, 2005, at 5:51 PM, Eirik Karlsen wrote:
Did a quick websearch for 'constructor', found little useful info.
So what kinda animal is a "constructor" and what does it do?
Stuart Malin wrote:
On Feb 22, 2005, at 5:11 PM, Joseph Claeys wrote:
So just stick the code in a constructor...
Be careful with that approach -- the Constructor runs BEFORE the Open
event.
And, in the Constructor, specific values of the object's properties
are
NOT available.
~joe
--
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|