Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1770 > unrolled thread

Subclassing

Started byCarlos Rocha <carlos.rochaDELETETHIS@doossier.com>
First post2011-07-31 20:25 +0100
Last post2011-08-01 14:11 +0200
Articles 4 — 2 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Subclassing Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-07-31 20:25 +0100
    Re: Subclassing Massimo Bighelli <info@arcasistemi.it> - 2011-07-31 22:41 +0200
      Re: Subclassing Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-07-31 21:57 +0100
        Re: Subclassing Massimo Bighelli <info@arcasistemi.it> - 2011-08-01 14:11 +0200

#1770 — Subclassing

FromCarlos Rocha <carlos.rochaDELETETHIS@doossier.com>
Date2011-07-31 20:25 +0100
SubjectSubclassing
Message-ID<4e35ac5f$0$11496$a729d347@news.telepac.pt>
Hi all,

Please consider the following:

//---------------------------------
Class ChildA
export Var1 as ClassVar1

//---------------------------------
Class ChildB inherit ChildA

//---------------------------------
Class ClassVar2 inherit ClassVar1
export AddedVar as Whatever

//---------------------------------
method Init(oOwner) class ChildB
super:Init(oOwner)

self:Var1 := ClassVar2{self}		// This works fine

return self

//---------------------------------
method SomeMethod() class ChildB

? Var1:AddedVar	
// WARNING: AddedVar is not an access of class ClassVar1: 51463

return nil
//---------------------------------------------------------------

Is there any workaround for this, apart from disabling the warning?


-- 
Carlos Rocha


---
avast! Antivirus: mensagem Enviada limpa.
Base de Dados de virus (VPS): 110730-0, 30-07-2011
Testada a: 31-07-2011 20:25:54
avast! - copyright (c) 1988-2011 AVAST Software.
http://www.avast.com


[toc] | [next] | [standalone]


#1771

FromMassimo Bighelli <info@arcasistemi.it>
Date2011-07-31 22:41 +0200
Message-ID<j14emh$2c1$1@speranza.aioe.org>
In reply to#1770
Carlos,

Il 31/07/2011 21:25, Carlos Rocha ha scritto:

> self:Var1 := ClassVar2{self}        // This works fine

I dont beleve this works fine for your porpouse...
IMO here you loose the ClassVar2 exported var.

Massimo

[toc] | [prev] | [next] | [standalone]


#1773

FromCarlos Rocha <carlos.rochaDELETETHIS@doossier.com>
Date2011-07-31 21:57 +0100
Message-ID<4e35c1da$0$11500$a729d347@news.telepac.pt>
In reply to#1771
Yes, that's my problem, but this seems to work:

//---------------------------
Class ChildB inherit ChildA
export Var2 as ClassVar2

//---------------------------------
method Init(oOwner) class ChildB
super:Init(oOwner)

Var2 := ClassVar2{self}
Var1 := Var2

return self
//-------------------------------------



>
>> self:Var1 := ClassVar2{self} // This works fine
>
> I dont beleve this works fine for your porpouse...
> IMO here you loose the ClassVar2 exported var.
>
> Massimo

-- 
Carlos Rocha


---
avast! Antivirus: mensagem Enviada limpa.
Base de Dados de virus (VPS): 110730-0, 30-07-2011
Testada a: 31-07-2011 21:57:33
avast! - copyright (c) 1988-2011 AVAST Software.
http://www.avast.com


[toc] | [prev] | [next] | [standalone]


#1776

FromMassimo Bighelli <info@arcasistemi.it>
Date2011-08-01 14:11 +0200
Message-ID<j1655r$25i$1@speranza.aioe.org>
In reply to#1773
yes, and this is correct IMO.
Now you Init correctly ClassVar2, and then you transfer the ClassObject 
to Var2

 > Var2 := ClassVar2{self}

the next line is a mere pointer assignement

 > Var1 := Var2

IMO all this is correct, but the previous version wasn't.

:-)

Massimo



Il 31/07/2011 22:57, Carlos Rocha ha scritto:
> Yes, that's my problem, but this seems to work:
>
> //---------------------------
> Class ChildB inherit ChildA
> export Var2 as ClassVar2
>
> //---------------------------------
> method Init(oOwner) class ChildB
> super:Init(oOwner)
>
> Var2 := ClassVar2{self}
> Var1 := Var2
>
> return self
> //-------------------------------------
>
>
>
>>
>>> self:Var1 := ClassVar2{self} // This works fine
>>
>> I dont beleve this works fine for your porpouse...
>> IMO here you loose the ClassVar2 exported var.
>>
>> Massimo
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web