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

Home » Public Forums » archive » Re: redout of "name", "type" and "value" tags into a string
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: redout of "name", "type" and "value" tags into a string [message #54092] Wed, 23 May 2007 08:33
BavarianMike86 is currently offline  BavarianMike86
Messages: 9
Registered: May 2007
Junior Member
@ Vince:
"impractical" ... I think this word caused misunderstanding due to
language barrier ;-) I just wanted to say that this method is unhandy
for an IDL novice like me.

@ Lajos and David:
Thank you for your lead. This method works excellent.
By the way, David. We use your libraries here at office. Thanks for
your work. It makes many things much easier!

Greetings from Bavaria,
Michael
Re: redout of "name", "type" and "value" tags into a string [message #54113 is a reply to message #54092] Mon, 21 May 2007 11:23 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 21, 10:55 am, BavarianMike86 <jo.mich...@gmx.de> wrote:
> Thank you for your help, Ben and Vince!
>
> It is impractical if there's no easy way to read in the "Value" tags.
> But I discovered that also the HELP-function shows me all the
> information I need.
> Is it possible to copy the HELP-function generated text on the
> logscreen into a text array?
>
> This text array is necessary for me because I want to build a widget
> which shows exactly this information.
>
> Greetings,
> Michael

Impractical? That I don't understand...

I just threw this together in about 45 seconds. I think it only took
that long because it's Monday:

pro help_str, struct

tab = string(9b)

if size(struct,/type) ne 8 then return

tnames = tag_names(struct)
for i=0, n_tags(struct)-1 do begin
vnow = struct.(i)
printf, -1, tnames[i] + tab + size(vnow,/tname) + tab + strtrim(vnow,
2)
endfor

return
end

Cheers,
Vince
Re: redout of "name", "type" and "value" tags into a string [message #54114 is a reply to message #54113] Mon, 21 May 2007 09:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
BavarianMike86 writes:

> Is it possible to copy the HELP-function generated text on the
> logscreen into a text array?
>
> This text array is necessary for me because I want to build a widget
> which shows exactly this information.

Try the OUTPUT keyword to HELP.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: redout of "name", "type" and "value" tags into a string [message #54115 is a reply to message #54114] Mon, 21 May 2007 09:16 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Mon, 21 May 2007, BavarianMike86 wrote:

> Thank you for your help, Ben and Vince!
>
> It is impractical if there's no easy way to read in the "Value" tags.
> But I discovered that also the HELP-function shows me all the
> information I need.
> Is it possible to copy the HELP-function generated text on the
> logscreen into a text array?
>
> This text array is necessary for me because I want to build a widget
> which shows exactly this information.
>
> Greetings,
> Michael
>
>

HELP, OUTPUT=out, ...

regards,
lajos
Re: redout of "name", "type" and "value" tags into a string [message #54116 is a reply to message #54114] Mon, 21 May 2007 08:55 Go to previous message
BavarianMike86 is currently offline  BavarianMike86
Messages: 9
Registered: May 2007
Junior Member
Thank you for your help, Ben and Vince!

It is impractical if there's no easy way to read in the "Value" tags.
But I discovered that also the HELP-function shows me all the
information I need.
Is it possible to copy the HELP-function generated text on the
logscreen into a text array?

This text array is necessary for me because I want to build a widget
which shows exactly this information.

Greetings,
Michael
Re: redout of "name", "type" and "value" tags into a string [message #54118 is a reply to message #54116] Mon, 21 May 2007 07:07 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 21, 4:03 am, BavarianMike86 <jo.mich...@gmx.de> wrote:
> Hello!
> I hope you can help me:
>
> I have a structure. I can redout and print the structure tags using
> the TAG_NAMES function.
> But I also want to readout the "Type" and "Value" tags into a string
> array.
> How can I do that?
>
> Greetings from Bavaria,
> Michael

Here's a quickie:

Loop through the tags and use xxxx.tag_name[i] and use
size(xxxx.tag_name[i],/type).
Re: redout of "name", "type" and "value" tags into a string [message #54119 is a reply to message #54118] Mon, 21 May 2007 07:06 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On May 21, 5:03 am, BavarianMike86 <jo.mich...@gmx.de> wrote:
> Hello!
> I hope you can help me:
>
> I have a structure. I can redout and print the structure tags using
> the TAG_NAMES function.
> But I also want to readout the "Type" and "Value" tags into a string
> array.
> How can I do that?
>

Hi,

Getting the type names isn't too hard. You could wrap the follwoing
into a function.

IDL> n = n_tags(!X)
IDL> s = STRARR(n)
IDL> for i =0,n-1 do s[i]=SIZE(!X.(i),/TNAME)
IDL> print, s

But getting the value is not straight forward as a structure field
could be quite complex, like a pointer, object or another structure.
Besides, that is really what the "." operator does for you, it returns
the value of the field. Like...

print, !X.range

Ben
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: OT: recommendations for high preformance workstations
Next Topic: Re: idlwave and emacs "empty input ring"

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

Current Time: Wed Oct 08 15:26:57 PDT 2025

Total time taken to generate the page: 0.00590 seconds