#DIM ALL FUNCTION PBMAIN () AS LONG DIM filespec AS STRING, linein AS STRING DIM linecount AS LONG, L0 AS LONG, ok AS LONG filespec = DIR$(COMMAND$(1)) WHILE LEN(filespec) linecount = 0: ok = 0 OPEN filespec FOR INPUT AS 1 OPEN filespec & ".tmp" FOR OUTPUT AS 2 DO UNTIL EOF(1) LINE INPUT #1, linein INCR linecount IF VAL(COMMAND$(2)) <> linecount THEN PRINT #2, linein ELSE ok = -1 FOR L0 = 2 TO VAL(COMMAND$(3)) IF EOF(1) THEN ok = 1 PRINT "Tried to remove beyond the end of "; filespec EXIT DO END IF LINE INPUT #1, linein NEXT END IF LOOP IF 0 = ok THEN PRINT "Lines to remove are beyond the end of "; filespec ELSEIF -1 = ok THEN PRINT filespec; ": done" END IF CLOSE filespec = DIR$ WEND END FUNCTION