Use of CloseProc/OpenProc
fernandes_edgar
I have a problem using the CloseProc/OpenProc functions.
I intend to use an external text editor to manage many procedures, and so I want to be able to reload them in Igor.
The code I use is the following:
function ReloadProcList()
String savDF= GetDataFolder(1)
NewDataFolder/O/S root:Packages:ReloadProc
string cmd
string/G filename, stringpath
NewPath/O pathfd, "Macintosh SSD:Users:efernand:Documents:WaveMetrics:Igor Pro 6 User Files:User Procedures:"
PathInfo pathfd
stringpath = S_path
filename="import_SCALA2.ipf"
sprintf cmd, "CloseProc/FILE=filename/COMP=0/P=pathfd"
Execute/P cmd
sprintf cmd, "OpenProc/V=1/P=pathfd filename"
Execute/P cmd
KillPath pathfd
end
String savDF= GetDataFolder(1)
NewDataFolder/O/S root:Packages:ReloadProc
string cmd
string/G filename, stringpath
NewPath/O pathfd, "Macintosh SSD:Users:efernand:Documents:WaveMetrics:Igor Pro 6 User Files:User Procedures:"
PathInfo pathfd
stringpath = S_path
filename="import_SCALA2.ipf"
sprintf cmd, "CloseProc/FILE=filename/COMP=0/P=pathfd"
Execute/P cmd
sprintf cmd, "OpenProc/V=1/P=pathfd filename"
Execute/P cmd
KillPath pathfd
end
The problem is that, when executed, "pathfd" is not defined, Igor says "No symbolic path of that name" (this was also the case for "filename", but I made it global to solve it), and therefore I do not know how to use OpenProc and CloseProc whith the symbolic path.
So, is there a good way to reload an external procedure file (automaticaly) with Igor?
Any input would be appreciated.
Protra
It seems like pathfd should exist. The commands specified by Execute/P do not execute until all functions return. Use Misc->Path Status to check symbolic paths.
In Igor7, which will be in beta testing before too long, using an external editor will be very simple - you just edit the file in the external editor, thanks to work by John Weeks.
October 7, 2015 at 09:35 am - Permalink
If you want the path killed, do that in another Execute/P statement after the OpenProc Execute/P.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
October 7, 2015 at 10:47 am - Permalink
Protra
October 7, 2015 at 11:33 pm - Permalink