Can I #include a file only if it isn't open?

Is there any way to conditionally #include an ipf only if it isn't already open?

I write instrument drivers for my colleagues that rely on procedures in the file MyIPF.ipf. To make sure they compile, I put MyFile.ipf in the User Procedures directory, and then put #include "MyIPF" at the beginning of my drivers. This works fine for me, but my colleagues like to keep their own versions of MyIPF.ipf open, saved in different folders, which leads to compile errors since they often use the same function names. Is there some way I can #include the file only if they haven't done this?
edwardlaird wrote:
... This works fine for me, but my colleagues like to keep their own versions of MyIPF.ipf open, saved in different folders, which leads to compile errors since they often use the same function names. Is there some way I can #include the file only if they haven't done this?


Based on the description of your problem, you might explore instead the options of coding as a module or independent module and setting your function calls as Static.

http://www.igorexchange.com/node/1688

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Quote:
Is there any way to conditionally #include an ipf only if it isn't already open?


I don't think so.

Quote:
my colleagues like to keep their own versions of MyIPF.ipf open, saved in different folders


This will lead to a proliferation of different versions of the file. If the purpose is to share the same code your colleagues should #include your version. If they want to be able to create customized versions then they should duplicate your file and create their own version using either a module or an independent module. This will of course lead to the proliferation of versions.