4Misc_StartÄ4Platformĸ@ åROGIXX²ý²ýzž²ý²ýzž,PÄ Ä Ä Ä VT$mKô1winspoolMicrosoft XPS Document WriterXPSPort:Microsoft XPS Document WriterœXÿê odXXLetterÿÿÿÿDINU"L ÊÒör SMTJMicrosoft XPS Document WriterInputBinFORMSOURCERESDLLUniresDLLInterleavingOFFImageTypeJPEGMedOrientationPORTRAITCollateOFFResolutionOption1PaperSizeLETTERColorMode24bpp MXDW åROGIXX²ý²ýzž²ý²ýzž,PÄ Ä Ä Ä VT$mKô1winspoolMicrosoft XPS Document WriterXPSPort:Microsoft XPS Document WriterœXÿê odXXLetterÿÿÿÿDINU"L ÊÒör SMTJMicrosoft XPS Document WriterInputBinFORMSOURCERESDLLUniresDLLInterleavingOFFImageTypeJPEGMedOrientationPORTRAITCollateOFFResolutionOption1PaperSizeLETTERColorMode24bpp MXDW åROGIXX¨ý¨ýp”¨ý¨ýp”<ì ì ì ì VT$mKô1winspoolMicrosoft XPS Document WriterXPSPort:Microsoft XPS Document WriterœXÿê odXXLetterÿÿÿÿDINU"L ÊÒör SMTJMicrosoft XPS Document WriterInputBinFORMSOURCERESDLLUniresDLLInterleavingOFFImageTypeJPEGMedOrientationPORTRAITCollateOFFResolutionOption1PaperSizeLETTERColorMode24bpp MXDW å ROGIXX¨ý¨ýp”¨ý¨ýp”<ì ì ì ì VT$mKô1winspoolMicrosoft XPS Document WriterXPSPort:Microsoft XPS Document WriterœXÿê odXXLetterÿÿÿÿDINU"L ÊÒör SMTJMicrosoft XPS Document WriterInputBinFORMSOURCERESDLLUniresDLLInterleavingOFFImageTypeJPEGMedOrientationPORTRAITCollateOFFResolutionOption1PaperSizeLETTERColorMode24bpp MXDW^Graph*@@wwwwwwï?wwwwwwï?leWDashSettings#úÿ  !¼ˆG,â©üNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$¼ˆG,â©üNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$444444¼ˆ ÷»lüNormalÿÿÿÿ@ ÿArialÿÿÿÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHHHH$$4 4 4 4 4 4 ahome-%dþÿÿÿ X:tmp:X:tmpX:\Pè‰ðýðýøø8ÝPàèØè°è,‘|Té ðçø’éé|@‘|ÿÿÿÿ=‘|U‚|ø’þ‚|Ðìþÿÿÿð xê!Té$&ø’€7ðýðýðýðýøûýÄètéøüÀšƒ|‚|ÿÿÿÿþ‚|¡}cµ}c4éþÿÿÿ‰‹þÿÿÿ~RecentWindowsJAdvanced Topics.ihfALOISARespesMenu.ipfHelp BrowserHOWTOTestProcedure 4Misc_EndÄ4XOPState_StartÄData Browserr Plot Matrix...nsGizmoPeakFunctions2SOCKITHÀG oXMLutils‘pà} GencurvefitèßTInterpolateÀbGNUsplit@‡èO£ÅData Browser‘root4XOPState_EndÄ\ˆ•SetIgorOption IndependentModuleDev=1 •StartHook() Setting IGOR hook •ShowHookName() TestIM#ExperimentSaveNotification; Saved "X:tmp:IMSetIgorHookExample.pxp" experiment •ShowHookName() ProcGlobal#TestIM#ExperimentSaveNotification; •RemoveHook() Removing IGOR hook Killing V_Flag and S_info which were set by IGOR during start-up •ShowHookName() No hook is set !¸¢ç*› d0TMW???? HOWTOHOWTOHOWTO0f 0f B/R0B/R0$NormalÿÿÿÿÔ ÿüÿÿÿÿÿÿÿÿ< ÈBHHHH$$ªDîZPîî ø åý ý ›The TestProcedure is the example IndependentModule (TestIM) where the IGOR BeforeExperimentSaveHook hook function is defined (ExperimentSaveNotification).  (HOWTO recreate the described behaviour:  )1. In the command window run StartHook() ÿÿÿÿÿÿy62. Check the name of the set IGOR hook function with ShowHookName() - it has the form TestIM#ExperimentSaveNotification; 5ÿÿÿÿÿÿCÿÿÿÿÿÿÿÿVÿÿÿÿ‡$3. Save the experiment - the hook function ExperimentSaveNotification gets properly called and a message appears in the command window +ÿÿÿÿÿÿEÿÿÿÿÿÿÿÿ&4. Close the experiment and reopen it T5. Now when IGOR starts-up it recreates all IGOR hooks and two globals are created: #$ - V_Flag (due to an Execute call) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$$ - S_info (due to SetIgorHook call) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿyAlready here one can see that the name of the set IGOR hook has changed to ProcGlobal#TestIM#ExperimentSaveNotification; KÿÿÿÿG6. Nevertheless, check again the name of the hook using ShowHookName() 8ÿÿÿÿÿÿe$7. Now save the experiment - the hook function ExperimentSaveNotification does NOT get called (BUG?) /ÿÿÿÿÿÿIÿÿÿÿÿÿÿÿ Thanks, GregorZü2:|2äj¸˜øˆžeArialÿÿÿÿÿÿÿROGIXX²ý²ýzž²ý²ýzž,PÄ Ä Ä Ä VT$mKô1winspoolMicrosoft XPS Document WriterXPSPort:Microsoft XPS Document WriterœXÿê odXXLetterÿÿÿÿDINU"L ÊÒör SMTJMicrosoft XPS Document WriterInputBinFORMSOURCERESDLLUniresDLLInterleavingOFFImageTypeJPEGMedOrientationPORTRAITCollateOFFResolutionOption1PaperSizeLETTERColorMode24bpp MXDWLd TXET????²TestProcedureTestProcedure#pragma rtGlobals=3 // Use modern global access method and strict wave access. #pragma IndependentModule = TestIM // This code is taken from the IGOR help for BeforeExperimentSaveHook Function ExperimentSaveNotification(rN,fileName,path,type,creator,kind) Variable rN,kind String fileName,path,type,creator PathInfo $path // puts path value into (local) S_path Printf "\rSaved \"%s\" experiment\r\r",S_path+fileName KillPath/A/Z // Delete all unneeded symbolic paths return 0 // not needed: Igor ignores the value returned by BeforeExperimentSaveHook End Function SetHook() SetIgorHook BeforeExperimentSaveHook=ExperimentSaveNotification return 0 EndÖ// Platform=WindowsNT, IGORVersion=6.340, architecture=Intel, systemTextEncoding="Windows-1252", historyTextEncoding="Windows-1252", procwinTextEncoding="Windows-1252" Silent 101 // use | as bitwise or -- not comment. DefaultFont "Arial" String/G root:gWMSetNextTextFilesTextEncoding = "Windows-1252" // Text encoding for "TestProcedure". Used by Igor Pro 7. OpenProc/W=(248.25,53.75,746.25,364.25)/J=13568 "TestProcedure" MoveWindow/P 443.25,503,876,798.5 MoveWindow/C 43.5,583.25,425.25,737.75 String/G root:gWMSetNextTextFilesTextEncoding = "Windows-1252" // Text encoding for HOWTO. Used by Igor Pro 7. OpenNotebook/N=HOWTO/W=(69,186.5,592.5,497)/J=10077 "HOWTO" KillStrings/Z root:gWMSetNextTextFilesTextEncoding Ü#pragma rtGlobals=3 // Use modern global access method and strict wave access Function ShowHookName() SetIgorHook BeforeExperimentSaveHook if (strlen(S_info)==0) print "No hook is set" else print S_info endif return 0 End // For testing purposes - beware: this will remove ALL BeforeExperimentSaveHooks! Function RemoveHook() print "Removing IGOR hook" SetIgorHook /K BeforeExperimentSaveHook print "Killing V_Flag and S_info which were set by IGOR during start-up" KillVariables /Z V_Flag KillStrings /Z S_info return 0 End // This is one of the ways I use in my package to start the hook Function StartHook() print "Setting IGOR hook" Execute /Q/P "TestIM#SetHook()" return 0 End