//in TSEPro\ui\tse.ui,insert below code integer proc isFile_linesBegin() string s[6],cf[6] PushPosition() BegFile() s=GetText(1,6) cf=GetText(CurrLineLen()-5,6) PopPosition() if s=="File: " and cf==" lines" return(1) endif return(0) end integer proc mIsEscKeyPressed() integer PressedKey = 0 if KeyPressed() while KeyPressed() PressedKey = GetKey() endwhile if PressedKey == return(TRUE) endif endif return(FALSE) end integer proc mDupAllLineNumHomPosition() integer line,col,r,t,f,n,row,xoff string s[2] if not isFile_linesBegin() return(0) endif s="N" if not Ask("Are you sure to duplicate all lines to the corresponding file (N/Y)?", s) return(0) endif if s<>"Y" return(0) endif line = CurrLine() col = CurrCol() row = CurrRow() xoff = CurrXoffset() EndFile() t=CurrLine() r=0 fnn=0 while (1) n=CurrLine() if n==1 break endif if (n mod 100)==0 Message("Duplicating line ",n,"/ ",t,", press to abort.") if mIsEscKeyPressed() break endif endif f=mDupLineNumHomPosition(n) if f==-1 break endif if f==1 r=1 endif Up() endwhile GotoLine(line) GotoColumn(col) ScrollToRow(row) GotoXoffset(xoff) UpdateDisplay(_STATUSLINE_REFRESH_) if r==1 and f<>-1 MsgBox(Chr(13)+"Have duplicated all lines to their corresponding file.") endif return(1) end integer proc mDupLineNumHomPosition(integer n) integer o,h,i,m,l,ns,j,k,lt255,cl,sl string nl[255],f[255],s[20],ln[255],cf[255] if not isFile_linesBegin() fnn=0 return(0) endif cf=CurrFilename() s = GetText(1,20) m = 1 while (1) if (s[m] <> ':') m = m + 1 if (m >= 20) fnn=0 return(0) endif else break endif endwhile s = GetText(1,m-1) sl = Val(Ltrim(s)) if sl<=0 fnn=0 return(0) endif cl=CurrLineLen() if cl 255) i = 255 endif nl = GetText(1,i) ns = pos("File:",nl) if (ns == 1) o = pos("occurrences",nl) if (o > 10) f = GetText(1,o-2) f = DelStr(f,1,6) for j=o-2 downto 1 if f[j]==' ' break endif endfor f = SubStr(f,1,j-1) GotoLine(l) break else GotoLine(l) fnn=0 return(0) endif endif endwhile fnn=h lastf=f else if n>fnn f=lastf else fnn=0 goto SEEK endif endif if Pos("*",f)>0 GotoLine(l) Warn("The file name to be duplicated cannot contain *, please change the name before using the duplicate function") fnn=0 return(-1) endif EditFile(QuotePath(f)) GotoLine(sl) BegLine() DelToEol() if lt255==0 InsertText(ln,_INSERT_) else m=m+2 while (1) EditFile(QuotePath(cf)) ln=GetText(m,255) EditFile(QuotePath(f)) if ln=="" break endif InsertText(ln,_INSERT_) m=m+255 endwhile endif EditFile(QuotePath(cf)) return(1) end mDupAllLineNumHomPosition()