' if editor is not clicked then linecount at start is 0 ' if editor is clicked then linecount at start is 1 if linecount=0 then ' linecount is 0 only if starting without clicking the editor ' so then global1 can start at 0 ' if the editor is clicked then global3 is 0 ' use this global3 to adjust the line to get global3=1 end if s= GetIOLine Global1=Global1+1 x=instr(s,"LOMA CHECKWEIGHER") if x>0 then Rep=trim(getline(Global1-1-global3)) Dat=trim(getline(Global1-3-global3)) 'get date&Time stamp from file Filenam = Rep & " - " & Dat Filenam=replace(Filenam,":","-") ' remove colons from filename Ext=".TXT" 'DefaultExt if Ext=".*" then Ext="" end if TriggerAutoSave(Filenam+Ext) end if