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

Home » Public Forums » archive » Alternative to EXECUTE?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Alternative to EXECUTE? [message #37191] Tue, 02 December 2003 06:40 Go to previous message
anne.martel is currently offline  anne.martel
Messages: 6
Registered: April 2002
Junior Member
I've just realised that the IDL Virtual Machine won't work with
EXECUTE. Does anyone have an alternative for the sort of use described
below?

I'm using EXECUTE to initialise an object with a set of fields defined
by the structure info. The number of fields defined in info will vary
depending on the type of image I'm reading in so I only want to set a
subset of the fields. I could explicitity test for each tag name but
that makes it harder to add new fields later and I would end up with a
very long CASE statement.

pro QmcImage::set_info,info
tmp_class = {QmcImage}
object_fields = Tag_Names(tmp_class)
info_fields = Tag_Names(info)
num=n_elements(info_fields)
for i = 0,num-1 do begin
index = where(strcmp( info_fields[i], object_fields,/F),count)
if(count eq 1) then begin
str='self.' + info_fields[i] + '= info.' + info_fields[i]
ok = execute(str)
endif
endfor
end

Thanks,

Anne Martel
Imaging Research,
Sunnybrook and Women's CHSC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multiple Axes
Next Topic: Perpendicular symbol

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

Current Time: Fri Oct 10 15:54:39 PDT 2025

Total time taken to generate the page: 1.27966 seconds