comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Need advice about inheritance
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Need advice about inheritance [message #44366 is a reply to message #44303] Fri, 10 June 2005 01:06 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
You *could* use

function data::add,data2

;; common code

if OBJ_CLASS(self) eq 'DATA' then begin

;; do everything for DATA ADD

endif else begin

;; do everything for TIMEDATA ADD

endelse

end

But this is goes again the concept of inheritance. Overloading ADD is
the much cleaner
way. Instead you should factorize you code, ie. define a
DATA::ADD_COMMON and put in there everything both ADD functions share
and
call it from both ADD functions leaving only the differnces there.

Cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: array of pointers inside a structure
Next Topic: Re: mosaic two images in direct graphics

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 03:23:46 PDT 2025

Total time taken to generate the page: 0.56059 seconds