- NAME
GETPRO
- PURPOSE
Search !PATH for a procedure, and copy into user's working directory
- EXPLANATION
Extract a procedure from an IDL Library or directory given in the
!PATH system variable and place it in the current default directory
(presumably to be edited by the user).
- CALLING SEQUENCE
GETPRO, [ proc_name ] ;Find PROC_NAME in !PATH and copy
- OPTIONAL INPUT
proc_name - Character string giving the name of the IDL procedure or
function. Do not give an extension. If omitted,
the program will prompt for PROC_NAME.
- OUTPUTS
None.
- SIDE EFFECTS
A file with the extension .pro and a name given by PROC_NAME will
be created on the user's directory.
- PROCEDURE
The FILE_WHICH() function is used to locate the procedure in the IDL
!PATH. When found, FILE_COPY is used to
copy the procedure into the user's current default directory. If not
found in !PATH, then the ROUTINE_INFO() function is used to determine
if it is an intrinsic IDL procedure.
- EXAMPLE
Put a copy of the USER library procedure CURVEFIT on the current
directory
IDL> getpro, 'CURVEFIT'
- RESTRICTIONS
User will be unable to obain source code for a native IDL function
or procedure, or for a FORTRAN or C routine added with CALL_EXTERNAL.
User must have write privilege to the current directory
- PROCEDURE CALLS
ZPARCHECK
- REVISION HISTORY
Written W. Landsman, STX Corp. June 1990
Now use intrinsic EXPAND_PATH() command W. Landsman November 1994
Use ROUTINE_NAMES() to check for intrinsic procs W. Landsman July 95
Update for Windows/IDL W. Landsman September 95
Check if procedure is in current directory W. Landsman June 1997
Use ROUTINE_INFO instead of undocumented ROUTINE_NAMES W.L. October 1998
Use FILE_WHICH() to locate procedure W. Landsman May 2006
Assume since V5.5, remove VMS support W. Landsman Sep 2006
Assume since V6.0, use file_basename() W.Landsman Feb 2009
Test for .sav file, more robust test for write privilege W.L. Jul 2010