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

Home » Public Forums » archive » Need IDL 8 Help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Need IDL 8 Help [message #87321 is a reply to message #87316] Fri, 24 January 2014 11:22 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Matthew Argall writes:

>
> I would do something like the following: Create a hash whose keys represent the message that is to be sent/received. The value of the key is a list that will contain each of the objects corresponding to that message. You can then check if an object is already in the list.
>
> IDL> theHash = hash()
> IDL> obj1 = obj_new('idl_container')
> IDL> obj2 = obj_new('idlanroi')
> IDL> message = 'CHANGED_COLORS'
> IDL>
> IDL> theHash[message] = List()
> IDL> if (max(theHash[message] eq obj1) eq 0) then theHash['CHANGED_COLORS'] -> add, obj1
> IDL> print, theHash[message]
> <ObjHeapVar21665(IDL_CONTAINER)>
> IDL>
> IDL>
> IDL> if (max(theHash[message] eq obj1) eq 0) then theHash['CHANGED_COLORS'] -> add, obj1
> IDL> print, theHash[message]
> <ObjHeapVar21665(IDL_CONTAINER)>
> IDL>
> IDL> if (max(theHash[message] eq obj2) eq 0) then theHash['CHANGED_COLORS'] -> add, obj2

Thanks, good suggestions. I think I have it working now. Although, I
have to admit, I don't really understand this code and the way you use
the Max function. But, making the value of the hash a list works pretty
well, I think. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TODO tag in IDL Workbench?
Next Topic: Unable to create X windows Window is iconified and has no backing store...

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

Current Time: Fri Oct 10 15:50:12 PDT 2025

Total time taken to generate the page: 1.52304 seconds