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

Home » Public Forums » archive » Re: bug? or how to distinguish between a Hash and an array of Hashes ?
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: bug? or how to distinguish between a Hash and an array of Hashes ? [message #83395 is a reply to message #83394] Mon, 04 March 2013 06:39 Go to previous messageGo to previous message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
I've updated this a bit. It seems that the HELP command can
distinguish between the two cases, but SIZE(), even with the /
STRUCTURE keyword specified, cannot.

pro test

a = hash('first', 1, 'second', 2)
b = hash('third', 3, 'fourth', 4, 'fifth', 5)

print, 'Output of SIZE() for a HASH varible:'
print, size(a, /STRUCTURE)

c = [a,b]
print, 'Output of SIZE() for an array of HASHes:'
print, size(c, /STRUCTURE)

help, a, output=ahelp
help, c, output=chelp

print, ahelp
print, chelp

end

IDL> test

Output of SIZE() for a HASH varible:

{ OBJREF 11 0 0 2
1 2 0 0 0
0 0 0 0
}

Output of SIZE() for an array of HASHes:

{ OBJREF 11 0 0 2
1 2 0 0 0
0 0 0 0
}

A HASH <ID=18 NELEMENTS=2>
C OBJREF = Array[2]

so I could solve this by parsing the output of HELP, but this is
strongly discouraged in the documentation for the IDL Help command
itself, as the text formatting of the output from this command my
change...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bug? or how to distinguish between a Hash and an array of Hashes ?
Next Topic: Nan represented by a gray area

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

Current Time: Wed Oct 08 18:18:20 PDT 2025

Total time taken to generate the page: 0.00464 seconds