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

Home » Public Forums » archive » Case Insensitive Hash but still preserve cases of original keys
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: Case Insensitive Hash but still preserve cases of original keys [message #89002 is a reply to message #89000] Sun, 13 July 2014 23:53 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi,

On 14.07.2014 08:24, SonicKenking wrote:
> I tried to implement a special Hash object with following features
> 1. Keys are of String type
> 2. Keys should be case insensitive
> 3. The original cases of keys should be preserved and reported when the keys() method is called.

this sounds like a dictionary to me:

IDL> h = dictionary()
IDL> h['X'] = 42
IDL> print, h.keys()
X
IDL> print, h['x'], h['X']
42 42
IDL> print, h.haskey('x'), h.haskey('X')
1 1
IDL> h['x'] = 1337
IDL> print, h['x'], h['X'] ; output 1337, 1337
1337 1337
IDL> print, h.keys()
x

Cheers,

Fabien
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CONTOUR: Data coordinate system not established error
Next Topic: Normalize image after running FLAASH

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

Current Time: Wed Oct 08 19:27:08 PDT 2025

Total time taken to generate the page: 0.00382 seconds