Re: undefined procedure problem [message #15891] |
Mon, 21 June 1999 00:00 |
Kristine Hensel
Messages: 26 Registered: June 1999
|
Junior Member |
|
|
Hi,
Just an update ...
I tried both (1) and (2) of Martin's suggestions, and got the same
"undefined procedure" error message. I also get the same error if,
instead of calling comment_ev, I try to call another event-handling
procedure that works fine in other contexts.
I also tried R. Bauer's suggestion of making sure that the event=
keyword in cw_form is given a string - in that case, I got an error
message saying that my string variable (event_string='comment_ev') was
an undefined procedure.
So I've given up on using cw_form for now. In hindsight, it wouldn't
have saved me that much programming anyway.
Thanks for the tips,
Kristine
P.S. Thanks, Martin, for your advice in (3) - I'll keep that in mind
next time I have a mysterious problem!
Martin Schultz wrote:
>
> maybe I am the wrong one to answer (because I am not that much into
> widgets), but perhaps the following tips can help:
> (1) try a call to resolve_routine,'comment_ev' before you call cw_form.
> That should ensure it gets compiled before cw_form is registered with
> xmanager.
> (2) try to put comment_ev in a seperate file with that name and make
> sure it is in the IDL !PATH.
> (3) if (2) works, my suspicion would be that comment_ev is embedded in a
> file after the routine that bears the name of the file. That's always
> dangerous.
>
> Good luck,
> Martin.
>
>
> --
>
> |||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
> Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
> Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
> e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
--
Kristine Hensel Phone: (303) 497-1539
High Altitude Observatory/NCAR E-mail: hensel@ucar.edu
P.O. Box 3000 Office: FL2 3070
Boulder, CO 80307-3000
|
|
|
Re: undefined procedure problem [message #15904 is a reply to message #15891] |
Sat, 19 June 1999 00:00  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Kristine Hensel wrote:
> Hi,
>
> I'm having trouble with IDL compiling a procedure and then telling me
> that the procedure is undefined:
>
> % Compiled module: COMMENT_EV.
> % XMANAGER: Caught unexpected error from client application. Message
> follows...
> % Attempt to call undefined procedure/function: 'COMMENT_EV'.
> % Execution halted at: XMANAGER_EVLOOP_STANDARD 471
> /opt/share/idl/lib/xmanager.pro
> % XMANAGER 699
> /opt/share/idl/lib/xmanager.pro
> % MANAGE_DATA 241
> /home/hensel/idl/mylib/manage_data.pro
> % $MAIN$
>
> I'm loathe to post my embarrassingly ugly (and long) code here unless I
> really have to, but the problem arose when I tried to use cw_form for
> the first time. I have "event=comment_ev" as a keyword to my buttons
> and text in the cw_form description:
>
> desc = [ $
> '0, label, Data comments, font=helvetica*14',$
> '1, base, , row',$
> '1, base, ,frame, column',$
> '0, label, E_x, font=helvetica*14, center',$
> '0, button, no data | wandering baseline | rapid oscillations,$
> font=helvetica*12, column, event=comment_ev, tag=ex_problem',$
> '2, text, , font=helvetica*12, label_left=other:, width=10,$
> event=comment_ev, tag=ex_other',$
> '1, base, , row',$
> '0, button, Save comments, font=helvetica*14, tag=save,
> event=comment_ev']
>
> comment_form = cw_form(comment_base, desc, /column)
>
> The procedures manage_data and comment_ev are in the same file, along
> with lots of other event-handling procedures that IDL has no trouble
> finding.
>
> Does anyone know of a less transparent meaning of the "undefined
> procedure/function" error message? Alternatively, am I using the
> "event=" keyword incorrectly in defining cw_form? There's no example of
> its use in the manuals I have.
>
The most done mistake with this is thats the event function has to be defined as
string.
If you like the event handler function comment_ev to be used you have to define
it as event='comment_ev'
or somewhere before set
comment_ev='comment_ev'
R.Bauer
|
|
|
Re: undefined procedure problem [message #15905 is a reply to message #15904] |
Fri, 18 June 1999 00:00  |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Kristine Hensel wrote:
>
> Hi,
>
> I'm having trouble with IDL compiling a procedure and then telling me
> that the procedure is undefined:
>
> % Compiled module: COMMENT_EV.
> % XMANAGER: Caught unexpected error from client application. Message
> follows...
> % Attempt to call undefined procedure/function: 'COMMENT_EV'.
> % Execution halted at: XMANAGER_EVLOOP_STANDARD 471
> /opt/share/idl/lib/xmanager.pro
> % XMANAGER 699
> /opt/share/idl/lib/xmanager.pro
> % MANAGE_DATA 241
> /home/hensel/idl/mylib/manage_data.pro
> % $MAIN$
> [...]
> Thanks,
> Kristine
>
maybe I am the wrong one to answer (because I am not that much into
widgets), but perhaps the following tips can help:
(1) try a call to resolve_routine,'comment_ev' before you call cw_form.
That should ensure it gets compiled before cw_form is registered with
xmanager.
(2) try to put comment_ev in a seperate file with that name and make
sure it is in the IDL !PATH.
(3) if (2) works, my suspicion would be that comment_ev is embedded in a
file after the routine that bears the name of the file. That's always
dangerous.
Good luck,
Martin.
--
|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
|
|
|