跳转至

Where am I?

原文链接: https://www.nv5geospatialsoftware.com/Learn/Blogs/Blog-Details/where-am-i

19551 Rate this article:

No rating

Where am I?

Anonym Thursday, May 16, 2013

Well, more accurately, "where on the filesystem is the source for the currently scoped routine?", but that's not a catchy title. In IDL 8.2.2, the ROUTINE_FILEPATH function was modified to return this information when called without any parameters. Here's a simple program demonstrating this behavior:



pro routine_filepath_no_params

   compile_opt idl2



   print, 'I''m called from a program in the file: ' + routine_filepath()

end

When I run this program, I get:



IDL> routine_filepath_no_params

I'm called from a program in the file: /home/mpiper/VIS/IDL/8/22/demos/src/routine_filepath_no_params.pro

Jim Pendleton, for example, has found this helpful in determining whether a program is being run from a SAVE file or a PRO file. I've used it to save a visualization to a PNG file with the same base name as the PRO file in which it's generated.

Systems and Services Suomi NPP: Setting a New Standard for Global Climate Monitoring