! ! SysErrMain.scr ! 3/16/98 file to control generating a system error file by doing phase avgs ! this file runs a pattern which runs the script file SysErrPatt.scr ! dim fn$[100] NumId = getid("Controls/Stitch/NRows") setnum(NumId ,1,"") NameId = getid("Controls/Stitch/StitchFile") fn$ = getval$(NameId) if ( fn$ = "" ) then fn$ = "SysErrFn.dat" setstr(NameId,fn$) endif os$ = getosname$ ! determine operating system if ( os$ = "HPUX" ) then ok = execute("rm -f " & fn$) else ok = execute("erase /f /q " & fn$) endif runpattern NumGoodMeas = getval(NumId ,"") NumGoodMeas = NumGoodMeas - 1 ! it was incr after last meas setnum(NumId ,NumGoodMeas ,"") if ( NumGoodMeas = 0 ) then ok = dialog("There were no valid measurements",2) goto EXIT endif loaddata(fn$) ScaleFactor = 1/NumGoodMeas scaledata(ScaleFactor) savedata(0,fn$) savepattern("SysErrGen.pat") EXIT: end