Using variables with #include
JM
Hi everyone!
I am trying to load in procedures from certain paths using #include. As this routine should work on different computers with different users, it would be useful to work with variables to provide the file path, e.g.
string path="C:user_XY:procedurefiles:test_procedure"
#include path
#include path
However, include does not accept string variables as input.
Is there a way around this?
You can use the operation queue with the "INSERTINCLUDE" and "COMPILEPROCEDURES " commands, see
DisplayHelpTopic "Operation Queue"
We are using that for testing if igor code compiles, see https://github.com/AllenInstitute/MIES/blob/d260d71edb7fd2f4e9034389eec… for some code using that.
December 4, 2019 at 05:58 am - Permalink
In reply to You can use the operation… by thomas_braun
Great - exactly what I was looking for!
Thanks,
JM
December 4, 2019 at 07:04 am - Permalink
The way we intended #include to work is that you would create a shortcut from "C:user_XY:procedurefiles" and put the shortcut in the "User Procedures" folder of the "Igor Pro User Files" folder. Then you would simply use:
#include "test_procedure"
More simply, you can require that each use put his procedurefiles folder directly in the "Igor Pro User Files" folder and then use a simple #include.
For information on the "Igor Pro User Files" folder, execute:
DisplayHelpTopic "Special Folders"
December 4, 2019 at 10:17 am - Permalink