gettingstarted
[Top] [All Lists]

Re: [RB List] NilObjectException?

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: [RB List] NilObjectException?
From: Russ Jones <russ dot jones at computer dot org>
Date: Tue, 22 Feb 2005 18:12:35 -0500
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <20050222221224 dot 2C14074C148 at lists dot realsoftware dot com> <d99853c08702b7f9d540bbb325d7bb9f at ossayu dot com> <421BB77B dot 63073CB4 at online dot no>
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>

<Prev in Thread] Current Thread [Next in Thread>