*tcInFile = "infile.txt" >>>*tcOutFile = "outfile.txt" >>>*tcSearchStr = "searchme" >>>function In2Out >>>parameters tcInFile, tcOutFile, tcSearchStr >>>#define MAXSIZE 1024 >>>* MAXSIZE is maxlen for a line >>>local lnInHandle, lnOutHandle, lnSize >>>lnInHandle = fopen(tcInFile) && Open input >>>lnSize = fseek(lnInHandle,0,2) && Get file size seeking to end >>>=fseek(lnInHandle,0,0) && Reset file pointer to beginning - starts at 0 offsett >>>lcContents = fread(lnInHandle,lnSize) && Read whole file >>>if occurs(lcSearchStr,lcContents) = 0 >>> messagebox("Search string not found.") >>> =fclose(lnInHandle) && Close file >>> return >>>endif >>>=fseek(lnInHandle,0,0) && Reset file pointer to beginning - starts at 0 offsett >>>lnOutHandle = fcreate(tcOutFile) && Create out file >>>do while !feof(lnInHandle) && Do while !eof >>> lcLine = fgets(lnInhandle,MAXSIZE) && Read a line >>> if tcSearchStr $ lcLine >>> =fputs(lnOutHandle,lcLine, MAXSIZE) && Write to out file >>> endif >>>enddo >>>=fclose(lnInHandle) && Close in file >>>=fclose(lnOutHandle) && Close out fileCetin