proc main string sLine1 ;Line of data read from file 1 string sLine2 ;Line of data read from file 2 integer iLen ;Holds length of sLine2 long lLen ;Long variable used in disk operations if fopen 0 "file1.txt" READ ;If file 1 is opened successfully if fopen 1 "file2.txt" READWRITE ;If file 2 is opened successfully while not feof 0 ;While data exists in file 1... fgets 0 sLine1 ;Read line from file 1 while not feof 1 ;While data exists in file 2... fgets 1 sLine2 ;Read line from file 2 if strcmp sLine1 sLine2 ;If lines are identical strlen sLine2 iLen ;Get length of line lLen = iLen ;Save in long variable for use in disk operations fseek 1 (-lLen) 1 ;Back up file pointer by length of current line fdelblock 1 iLen ;Delete current line from file 2 ftell 1 lLen ;Get current file pointer fclose 1 ;Close file 2 fopen 1 "file2.txt" READWRITE ;Reopen file so we can continue checking the remainder fseek 1 lLen 0 ;Set file pointer to previously-read location endif endwhile fclose 1 ;Close file 2 fopen 1 "file2.txt" READWRITE ;Reopen for next pass through file 2 endwhile endif endif fclose 0 fclose 1 endproc