// Bela Farago // // I am doing data acquisition (during weeks) with Igor and I print lot of // information in the History area. In the early times this did eat up all the // memory untill WM introduced the limit in number of lines which is kept. It // is commonly believed the discarded text is lost forever. WM was kind enough // to introduce an Easter Egg (let me be pretencious and say for me) to avoid // this. // If a text file exist in the directory path "home" with the same name as the // experiement + " History Archive", the discarded text goes there. // Now with my limited brain capacity I frequently a) forget to create it // b)misstype the name. // So with a friend of mine (Georg Ehlers to credit him) we made a little // function which is idiot-proof. Usually we start the experiment from // template which has this function already in the Procedure window. Eachtime // you save the experiment it checks for the existence of this file and if // does not exist it creates it. // WARNING: // 1) this is an undocumented, unsupported feature, use at your own risk // 2) I do not know if it works on the "wrong" platform or not Function BeforeExperimentSaveHook(rN,fileName,path,type,creator,kind) Variable rN,kind String fileName,path,type,creator String/g ArchiveName Variable/g fref PathInfo $path // puts path value into (local) S_path ArchiveName = fileName+" History Archive" Open /R/Z/P=home fref as ArchiveName if (V_flag != 0) Open /P=home/C="R*ch"/T="TEXT" fref as ArchiveName Printf "Created file "%s" in the home path\r",ArchiveName endif Close fref Printf "Saved "%s" experiment\r",S_path+fileName Return 0 End