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

Home » Public Forums » archive » Print 2 arrays side by side in one file
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: Pri [message #69900 is a reply to message #68672] Thu, 25 February 2010 12:12 Go to previous messageGo to previous message
JDS is currently offline  JDS
Messages: 94
Registered: March 2009
Member
On Feb 25, 9:53 am, Lasse Clausen <l...@lbnc.de> wrote:
> Hi there,
>
> I have written a little routine that prints out the usage of routines/
> procedures written in IDL on the command line. Like so:
>
> IDL> pri, 'reverse'
> +---+
> Function REVERSE
> Usage:
>   Result = REVERSE(A, SUBSCRIPTIN, OVERWRITE=OVERWRITE)
> Source:
>   /usr/local/itt/idl/lib/reverse.pro
> +---+


Since IDLWAVE does this as well (in context with C-c ?), but also
includes system routines (even when not available as .pro files), I
thought I'd mention how it does so. Since around IDL 6.2, ITT has
distributed with IDL an XML file which describes all of their
routines, system variables, object classes, etc.: idl/help/
idl_catalog.xml. It also gives detailed information on calling
syntax, keywords, etc. Here's some simple code to parse this XML file
to print the calling syntax of all the system routines for the
currently running version of IDL:


dom=obj_new('IDLffXMLDOMDocument',VALIDATION_MODE=0, $
FILENAME=filepath('idl_catalog.xml',SUBDIR='help'))
catalog=((dom->GetFirstChild())->GetNextSibling())->GetNextSibling()
routines=catalog->GetElementsByTagName('ROUTINE')

for i=0,routines->GetLength()-1 do begin
routine=routines->Item(i)
name=routine->GetAttribute('name')
syns=routine->GetElementsByTagName('SYNTAX')
print,name,':'
for j=0,syns->GetLength()-1 do $
print,' Syntax: ',(syns->Item(j))->GetAttribute('name')
endfor

obj_destroy,dom

A better version would gather the keywords as well (as IDLWAVE does)
and place them in the syntax. Then perhaps tuck away a pair of string
arrays into a common variable: sorted routine name, concatenated
calling syntax. This could be used to look-up syntax (either as first
priority, or second).

Beware of ALIAS_TO entries, which point to aliases for the actual
ROUTINE block, and could obviously be worked around. You could also
consider grabbing the CLASS elements, which contain METHOD children
with their own syntax, etc. Might be very useful to have an interface
to this on the command line.

JD

P.S. Is there a reason a->b()->c doesn't work in IDL? I'd have
thought `->' was left to right associative?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Grids on Minor Ticks.
Next Topic: Re: 0=1 (Double precision/Long64)

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

Current Time: Fri Oct 10 23:05:41 PDT 2025

Total time taken to generate the page: 0.23829 seconds