26 lines
645 B
Text
26 lines
645 B
Text
Proc strip_block_comments
|
|
Parameters string inhalt, beg_delim, end_delim
|
|
Declare long start, ende, anzahl
|
|
start = 1
|
|
start = InStr(beg_delim, inhalt, start)
|
|
While start > 0
|
|
ende = InStr(end_delim, inhalt, start + len(beg_delim))
|
|
If ende > 0
|
|
anzahl = ende + + len(end_delim) - start
|
|
inhalt = Del$(inhalt, start, anzahl)
|
|
Else
|
|
BREAK
|
|
EndIf
|
|
start = InStr(beg_delim, inhalt, start)
|
|
EndWhile
|
|
Return inhalt
|
|
EndProc
|
|
|
|
Cls
|
|
Declare string Text
|
|
Text = BlockRead("C:\Temp\Multiline_comment.txt")
|
|
Text = strip_block_comments(Text, "/*", "*/")
|
|
Print "Output:"
|
|
Print Text
|
|
WaitKey
|
|
End
|