Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Operator Convert (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: hidden classes
Next thread: Plugin Crashes in 2005


macosx and unix paths   -   GOLD
  Operator Convert   -   Alfred Van Hoek
   Re: Operator Convert   -   Mars Saxman
   Re: Operator Convert   -   Alfred Van Hoek
   Re: Operator Convert   -   Mars Saxman

Operator Convert
Date: 28.06.05 21:49 (Tue, 28 Jun 2005 16:49:53 -0400)
From: Alfred Van Hoek
When a class defines the Operator_Convert to convert from will the
default constructor of this class be called by REALbasic, or should the
plugin take care of it all and implement a copy constructor?

Alfred

_______________________________________________
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>

Re: Operator Convert
Date: 28.06.05 22:36 (Tue, 28 Jun 2005 14:36:45 -0700)
From: Mars Saxman

On Jun 28, 2005, at 1:49 PM, Alfred Van Hoek wrote:

> When a class defines the Operator_Convert to convert from will the
> default constructor of this class be called by REALbasic, or should
> the plugin take care of it all and implement a copy constructor?

The Operator_Convert from method takes the place of a constructor
method. It does not affect the behavior of the 'constructor' proc on
the REALclassDefinition (which I would like to rename 'initializer',
as it is unrelated to constructor methods).

Mars Saxman
REAL Software
_______________________________________________
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>

Re: Operator Convert
Date: 29.06.05 03:30 (Tue, 28 Jun 2005 22:30:57 -0400)
From: Alfred Van Hoek

On Jun 28, 2005, at 5:36 PM, Mars Saxman wrote:

> On Jun 28, 2005, at 1:49 PM, Alfred Van Hoek wrote:
>
>> When a class defines the Operator_Convert to convert from will the
>> default constructor of this class be called by REALbasic, or should
>> the plugin take care of it all and implement a copy constructor?
>
> The Operator_Convert from method takes the place of a constructor
> method. It does not affect the behavior of the 'constructor' proc on
> the REALclassDefinition (which I would like to rename 'initializer',
> as it is unrelated to constructor methods).

Got it, however:

Consider the following situation:

Class myClass: Operator_Convert(control as myControl)
Control myControl: Operator_Convert() as myClass

dim a as myClass
dim b as myControl

a = b

will not call the initializer of myClass, unless Operator_Convert() as
myClass is removed. This is intended behavior?

Alfred

_______________________________________________
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>

Re: Operator Convert
Date: 29.06.05 03:41 (Tue, 28 Jun 2005 19:41:28 -0700)
From: Mars Saxman

On Jun 28, 2005, at 7:30 PM, Alfred Van Hoek wrote:

> Consider the following situation:
>
> Class myClass: Operator_Convert(control as myControl)
> Control myControl: Operator_Convert() as myClass
>
> dim a as myClass
> dim b as myControl
>
> a = b
>
> will not call the initializer of myClass, unless Operator_Convert()
> as myClass is removed. This is intended behavior?

Yes. If both conversions exist, the "convert to" operator always
takes precedence over the "convert from" operator.

Mars Saxman
REAL Software
_______________________________________________
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>