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

Home » Public Forums » archive » Re: overload init function in class/object ?
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: overload init function in class/object ? [message #34989 is a reply to message #34988] Tue, 06 May 2003 12:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
paul wisehart (wisehart@runbox.com) writes:

> I was under the assumption that you could overload the
> init function of an object.
>
> However, it doesn't work for me.
>
> In the below example I get an error if I try:
> IDL>o = obj_new('obj')
>
> Yet this works:
> IDL>o = obj_new('obj','test')
>
> I wanna be able to overload my init functions!
> Please tell me I'm doing something wrong.
>
>
> ;--- obj__define.pro -------------------
>
> function obj::init
> compile_opt idl2
> return, 1
> end
> ;-----------------------
> function obj::init, p1
> compile_opt idl2
> print, p1
> return, 1
> end

I think it is your definition of "overload" that
is probably doing you in. :-)

I'm not sure what you mean by it, but it sure doesn't
mean "define the same thing twice, in two different ways".

What exactly are you trying to do here?

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sec : U Re: checking for Demo mode
Next Topic: Interpolation from a regular to an irregular grid?

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

Current Time: Sun Oct 12 06:14:57 PDT 2025

Total time taken to generate the page: 1.84012 seconds