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

Home » Public Forums » archive » What subprogram? What parameters and keywords?
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: What subprogram? What parameters and keywords? [message #85639 is a reply to message #85637] Fri, 23 August 2013 06:57 Go to previous messageGo to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den fredagen den 23:e augusti 2013 kl. 14:52:28 UTC+2 skrev David Fanning:
> Mats Löfdahl writes:
>
>> Let's say IDL has just entered a subroutine or function. Is any of the following information available?
>
>> 1. The name of the subprogram (like $0 in bash)
>> 2. The parameters as an array or struct or similar (kind of like $*), preferably including keywords.
>
> You can find two useful programs in the Coyote Library. WhoAmI returns
> the name of the program module the WhoAmI program is called in, and
> WhoCalledMe identifies the name of the program module that called the
> routine you are now in.
>
> There is no parameter stack that I am aware of, although it wouldn't
> surprise me if the Scope_*** routines could figure it out.

Thanks, that solves the first part of the problem! I'll read up on scope_*** and see if I can figure something out for the second part.


Note though that WhoCalledMe and WhoAmI give identical output when I try them. I believe WhoCalledMe needs the following edit:

callingRoutine = (StrSplit(StrCompress(callStack[(index-1) > 0])," ", /Extract))[0]

should be

callingRoutine = (StrSplit(StrCompress(callStack[(index-2) > 0])," ", /Extract))[0]

At least that fixed it for my test case.
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: operating on tab-/comma-delimited files
Next Topic: concatenating strings

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

Current Time: Wed Oct 08 17:19:23 PDT 2025

Total time taken to generate the page: 0.00523 seconds