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

Home » Public Forums » archive » [Object IDL] routines that require user-supplied functions ...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
[Object IDL] routines that require user-supplied functions ... [message #12640] Tue, 11 August 1998 00:00
dEdmundson is currently offline  dEdmundson
Messages: 23
Registered: February 1998
Junior Member
Here is a *demo* object-IDL code I wrote to illustrate a problem.
This object integrates x^n over the interval (a,b) using the
QROMB function. QROMB requires a user-defined function but I
cannot manage to pass the 'poly' method.

While this is a contrived example, one often wants to pass
object method functions/procedures to other IDL routines. Is
there a generic way of passing object methods to such intrinsic
routines?

Cheers,
Darran.


;;---------------------------------------------------------- ----------
;; save the following as test4__define.pro somewhere in your IDL path
;; uncomment one of the return statements in test4::integral
;; invoke the object with t = obj_new('test4',3.0,0.0,1.0)

function test4::init, degree, a, b
self.degree = degree
self.a = a
self.b = b
print, 'Integral = ', self->integral()
return, 0
end

function test4::integral
; try both of these ...
; return, qromb('test4::poly', self.a, self.b)
; return, qromb('self->poly', self.a, self.b)
end

function test4::poly,x
return, x^(self.degree)
end

pro test4__define
struct = {test4, degree:0.0, a:0.0, b:0.0}
end

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: external event triggering
Next Topic: Getting filename from PS device

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

Current Time: Fri Oct 10 06:01:17 PDT 2025

Total time taken to generate the page: 0.40074 seconds