Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

spedas/gui/utilities/

sourcepath.pro


Routines

top source SourcePath

result = SourcePath( [Base_Name=string])

This procedure returns the directory path associated with the routine calling this function. This is useful for building applications that need to bootstrap resource and configuration files when the installation directory may not be known until run time. Use this function in conjunction with FILEPATH to build platform-independent file path strings to your resources.
For example,

   b = WIDGET_BUTTON(tlb, /BITMAP, $
     VALUE=FILEPATH('up.bmp', ROOT = SourcePath(), SUBDIR = ['resource'])
This will search for a file named "up.bmp" in the subdirectory named "resource" below the directory in which is located the source code (or SAVE file) for the routine containing the above statement.

Return value

The return value is the root directory path to the calling routine's source file or SAVE file.

Keywords

Base_Name out optional type=string

Set this keyword to a named variable to retrieve the base file name of the routine's source.

Examples

   Create a file myapp.pro with the contents and run it.
     PRO MYAPP
     PRINT, SourcePath()
     END
   The printed output will be the full path to the
   directory in which abc.pro was created, regardless of
   IDL's current working directory.

Author information

History:

03/18/2005 JLP, RSI - Original version

File attributes

Modification date: Thu Feb 13 16:41:46 2014
Lines: 10