Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Martin Schultz (mgs@io.harvard.edu) writes: > today I finally got around improving my concept of displaying help > information on self-written (and library!) routines. Please find > attached > function routine_name.pro - which returns the name of the caller > routine > and > procedure usage.pro - which displays the "user-relevant" portion of > the IDL program header (with minor modifications). > > The idea of these routines is to prevent wrist injury from too much > double typing in constructs like: > if (keyword_set(help)) then begin > print ; all the stuff that's in the header anyway > endif Thanks for this, Martin. And although I hate to mention it, your Usage program duplicates functionality that is already there in IDL in the form of Doc_Library. Yours does have the significant advantage of having 6 fewer letters to type in the name. :-) I do like the touch of getting the name of the program off the stack. I never thought of doing that before. Let's just say that great minds think alike. :-) Cheers, David ----------------------------------------------------------- David Fanning, Ph.D. Fanning Software Consulting E-Mail: davidf@dfanning.com Phone: 970-221-0438 Coyote's Guide to IDL Programming: http://www.dfanning.com/