Issues with Two Procedures of Same Name
geologic
I was using a procedure I found on Igor Exchange (http://www.igorexchange.com/node/402, used for setting and making new data folders).
I tested it, found it to work, and then wanted to copy it to the procedure I have containing many working procedures. So I opened that procedure ("workingfiles.ipf"), and copied and pasted the procedure I had found on IgorExchange. But now I've got two procedures with the same name and things start to jam up. Is there a right way to proceed here?
If you have several "packages" it might happen that there are functions with the same name. "Init" is a classic.
On the one hand, you can rename these functions to make them unique again, e.g., "XPS_Init", "AES_Init", "Raman_Init", etc.
On the other hand, you might be able to use
static
functions. However, these functions are only visible to other functions in that file (hence, two functions in the same package still must have unique names) and not to user menus or the command line. Two static functions with the same name in different packages are working.Personally, I use a mixed approach. Everything that only concerns one project is declared "static" (so other developers and I don't have to worry about name conflicts) and the "public" functions share a common, highly specific descriptor, e.g. , "PFUDOR_Init".
As I writhe these lines, I see that maybe I misinterpreted your question:
It also might happen that you have the identical function in your collection ("workingfiles.ipf") and the "procedure window" (the one accessed by ctrl-m). In this case, just delete the function from the latter window and compile again.
HJ
September 21, 2015 at 07:21 am - Permalink
September 21, 2015 at 07:58 am - Permalink
And if a colleague is working on a different topic, but also in Igor, and you share .ipf-files, hell breaks loose. (One of my students I had 7 (sic) functions called "init" open in one experiment file and was wondering what was wrong)
HJ
September 21, 2015 at 12:59 pm - Permalink