Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
infile$ = "C:\sample.c"
|
||||
outfile$ = "C:\stripped.c"
|
||||
|
||||
PROCstripblockcomments(infile$, outfile$, "/*", "*/")
|
||||
END
|
||||
|
||||
DEF PROCstripblockcomments(infile$, outfile$, start$, finish$)
|
||||
LOCAL infile%, outfile%, comment%, test%, A$
|
||||
|
||||
infile% = OPENIN(infile$)
|
||||
IF infile%=0 ERROR 100, "Could not open input file"
|
||||
outfile% = OPENOUT(outfile$)
|
||||
IF outfile%=0 ERROR 100, "Could not open output file"
|
||||
|
||||
WHILE NOT EOF#infile%
|
||||
A$ = GET$#infile% TO 10
|
||||
REPEAT
|
||||
IF comment% THEN
|
||||
test% = INSTR(A$, finish$)
|
||||
IF test% THEN
|
||||
A$ = MID$(A$, test% + LEN(finish$))
|
||||
comment% = FALSE
|
||||
ENDIF
|
||||
ELSE
|
||||
test% = INSTR(A$, start$)
|
||||
IF test% THEN
|
||||
BPUT#outfile%, LEFT$(A$, test%-1);
|
||||
A$ = MID$(A$, test% + LEN(start$))
|
||||
comment% = TRUE
|
||||
ENDIF
|
||||
ENDIF
|
||||
UNTIL test%=0
|
||||
IF NOT comment% BPUT#outfile%, A$
|
||||
ENDWHILE
|
||||
|
||||
CLOSE #infile%
|
||||
CLOSE #outfile%
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue