Re: Help ! [message #14902 is a reply to message #10451] |
Thu, 01 April 1999 00:00   |
William Daffer
Messages: 34 Registered: February 1999
|
Member |
|
|
VU KHAC Tri <tvk@info.fundp.ac.be> writes:
> Hi folks,
>
> I write a procedure which reads an image when a button pressed.
>
> pro BTLoad_Event, event
> WIDGET_CONTROL, event.id, GET_UVALUE = info
> fname = DIALOG_PICKFILE(FILE = info.filename, /READ, FILTER = '*.hdr',
> $
> /MUST_EXIST, /FIX_FILTER, PATH = path, /NOCONFIRM)
> IF fname NE "" THEN BEGIN
> Read_Analyze, fname, info.image
> ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ENDIF
> end
>
> pro Read_Analyze, File, Image
> ;it reads some data from the file and modifies some fields in Image
> end;
>
> I see that in the Read_Analyze, data is read correctly, but in
> BTLoad_Event, info.image is not modified. Anyone can tell me why ?
>
> Best regards,
> Tri.
info.image is passed by value, or as a reference to a temporary
variable, I'm not sure which. I think if you change it in the
following manner, it'll work.
IF fname NE "" THEN BEGIN
image=info.image
Read_Analyze, fname, image
info.image =image
ENDIF
or, maybe pointers?
whd
--
My mail address has been mangled by my mailer. Send replies to...
daffer@primenet.com
--
Outside of a dog, a book is man's best friend
Inside of a dog, it's too dark to read.
Groucho Marx.
|
|
|