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

Home » Public Forums » archive » 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
overload init function in class/object ? [message #34990] Tue, 06 May 2003 12:29
paul wisehart is currently offline  paul wisehart
Messages: 28
Registered: December 2002
Junior Member
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

;-----------------------

pro obj::cleanup
compile_opt idl2
end

;=======================
pro obj__define
compile_opt idl2

obj = { obj, $
d1: 0, $
d2: 0 }

end
;=======================
;--- obj__define.pro -------------------

--
paul \ /
wisehart >/
<//////$>
|\|\|\
[Message index]
 
Read Message
Previous Topic: Re: Passing file LUN to C routine
Next Topic: Re: 48 variable limit?

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

Current Time: Wed Oct 08 19:37:42 PDT 2025

Total time taken to generate the page: 0.00359 seconds