proc main string sLine ;Line of data read from/written to open file string sPrevLine ;Previous line of data from file integer iLen ;Holds length of sLine long lLen ;Long variable used in disk operations if fopen 0 "test.txt" READWRITE ;If file is opened successfully while not feof 0 ;While data exists... fgets 0 sLine ;Read line from file if not strcmp sLine sPrevLine ;If data is not identical to previous line sPrevLine = sLine ;Then save current data for next compare else strlen sLine iLen ;Get length of line lLen = iLen ;Save in long variable for use in disk operations fseek 0 (-lLen) 1 ;Back up file pointer by length of current line fdelblock 0 iLen ;Delete current line ftell 0 lLen ;Get current file pointer fclose 0 ;Close file fopen 0 "test.txt" READWRITE ;Reopen file so we can continue checking the remainder fseek 0 lLen 0 ;Set file pointer to previously-read location endif endwhile fclose 0 ;Close file endif endproc