It's not working properly
For example:
[syntax="qbasic"]
'-- ******************************************'
sub DelComments (STxt$ as string)
'delete comments in SrcTxt$
'function tally - see
http://forum.qbasicnews.com/viewtopic.php?t=8787
' qt as string =chr$(34)
NQT=tally(STxt$, qt)
PQT1=0
PQT2=0
PRem=0
for i=0 to NQT+1
PQT1=instr(PQT2+1,STxt$, qt)
if PQT1=0 and PQT2>0 then ' no quotes yet
i=NQT+1
else
PQT2=instr(PQT1+1,STxt$, qt)
end if
'PQT2=instr(PQT1+1,STxt$, qt)
PRem=instr(PRem+1,STxt$, "'")
if (PRem < PQT1 and PRem >0) or (PQT1=0 and PRem >0) then
STxt$=left$(STxt$,PRem-1)
'print"2STxt$=";STxt$
exit for
else
PRem=PQT2
end if
next
end sub '
'-- *****************************************'
[/syntax]
1. Rem substring in PRem recognized as comment begin :o
2. Usually basic hilited as
for i=0
to NQT+1
' comment