realbasic-plugins
[Top] [All Lists]

Re: Class Constructor

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Class Constructor
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Fri, 26 Jan 2007 20:16:22 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <DEA8CA51-784E-4EB9-BC77-1761D75DFD0F at cahir dot net> <3AF5FF88-9E8D-435D-A6F4-208A9801D333 at great-white-software dot com> <F791208F-2EA6-40A9-8B2D-652ECA72064C at cahir dot net>

On Jan 26, 2007, at 7:26 PM, Stephen A. Cochran Lists wrote:


On Jan 26, 2007, at 9:13 PM, Norman Palardy wrote:

void ?

But isn't a constructor actually returning an instance of the class?

In the following message:

<http://support.realsoftware.com/listarchives/realbasic-plugins/ 2005-11/msg00047.html>

Joe implies that a function called "Constructor" in the Method definition is special, acting like a real constructor. From that I would assume you could do either of the following:

peep1 = new myPersonClass()
peep2 = new myPersonClass("Fred", 37)

And while I know in C++ you don't declare a return type, I wasn't sure in RB.

No return type
RB constructors do not allocate or create anything they just initialize things

You can actually call a constructor on a class at ANY tie just like a method
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


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