proc main string sLine string sDone = " COMPLETE" string sProblem = " INCOMPLETE" integer iLen if isfile "C:\TestFile.txt" ;If file exists... fopen 1 "C:\TestFile.txt" READWRITE TEXT while not feof 1 ;While there is still data in the file... fgets 1 sLine ;Read a line of data strlen sLine iLen ;Get length of sLine if iLen == 0 ;If sLine is zero-length, then exit the while loop exitwhile endif ;INSERT WRITE sDone TO TEXT FILE SCRIPT HERE fseek 1 (-2) 1 ;Back the file pointer up two bytes to account for the carriage return and linefeed finsblock 1 9 ;Insert enough bytes to add the new string fwrite 1 sDone 9 ;Write the string to the file, fwrite is used so that no CR/LF is added ;INSERT WRITE sProblem TO TEXT FILE SCRIPT HERE finsblock 1 11 fwrite 1 sProblem 11 fseek 1 2 1 ;Advance file pointer past previously-read CR/LF so we are ready to read next line endwhile fclose 1 endif endproc