save a procedure?

Hi there, so I'm working on a project in which a Notebook is created, saved as an ipf, then "included" in the project. Everything works fine, but I wonder is there a way to "save the procedure" as if it were created in the psp, so that I can delete the "included" external ipf, making the project more organic and portable? The reason that I wanted to do this is, if I were to share the pxp file with others, I'll probably have to share the ipf as well, which sometimes could be annoying.

Alternatively, I was imaging if I could directly create a procedure and write stuff in it, it would be even better.

Hope it's not a super silly question. Any suggestions would be helpful. Thank you very much!

File->Adopt Procedures

DisplayHelpTopic "Adopting Notebook and Procedure Files"
baroques_solari wrote:
.. but I wonder is there a way to "save the procedure" as if it were created in the psp

.. Alternatively, I was imaging if I could directly create a procedure and write stuff in it, it would be even better.


I think that if you make a new procedure window (windows > new > procedure...) and paste your code there or in the main procedure window (which will include the procedure in ProcGlobal namespace, if you will) it will be saved with the experiment and available only in this particular experiment.

The only way I know to programatically write/create a function in the experiment procglobal namespace, i.e. write the function to the procedure window, is to write an XOP that does that. But it will be far from elegant: exposing a function call into Igor taking a string as the name of the function and a string as the body of the function, and all kinds of ad-hoc checks.

best,
_sk