проблема в том, что мне нужно искать в тексе кавычки """ а VB ругается


Private Sub ColorTags(rch As RichTextBox)
Dim txt As String
Dim tag_open As Long
Dim tag_close As Long
Dim quote_open As Long
Dim quote_close As Long
Dim qu2_open As Long
Dim qu2_close As Long
txt = rch.Text
tag_close = 1
quote_close = 1
qu2_close = 1
Do
' начало тэга
tag_open = InStr(tag_close, txt, "<")
If tag_open = 0 Then Exit Do
' канец тэга
tag_close = InStr(tag_open, txt, ">")
If tag_open = 0 Then tag_close = Len(txt)
' выделение цветом
rch.SelStart = tag_open - 1
rch.SelLength = tag_close - tag_open + 1
rch.SelColor = vbRed
'кавычки
quote_open = InStr(quote_close, txt, Chr(34)???)
If quote_open = 0 Then Exit Do
'закр кав
quote_close = InStr(quote_open, txt, Chr(34)???)
If quote_open = 0 Then quote_close = Len(txt)
'выделение кавычек
rch.SelStart = quote_open - 1
rch.SelLength = quote_close - quote_open + 1
rch.SelColor = vbBlue
Loop
End Sub
Private Sub Form_Load()
Dim fnum As Integer
Dim txt As String
RchHidden.Move RchHidden.Width - 120, 0
fnum = FreeFile
Open App.Path & "\readmedt.htm" For Input As fnum
txt = Input$(LOF(fnum), fnum)
RchHidden.Text = txt
Close fnum
' Color the HTML tags.
ColorTags RchHidden
' Copy the result to the visible text box.
RchHidden.SelStart = 0
RchHidden.SelLength = Len(RchHidden.Text)
rchVisible.SelStart = 0
rchVisible.SelLength = Len(rchVisible.Text)
rchVisible.SelRTF = RchHidden.SelRTF
End Sub
Private Sub Form_Resize()
rchVisible.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
quote_close = InStr(quote_open, txt, Chr(34)???)
quote_close = InStr(quote_open, txt, Chr(34)???)
serix писал(а):C кавычками разобрался сам chr(34) и усе
Вот только фигня получилась: тэги выделяются, т.к. < и > разные символы, а кавычки-то одинаковые, может у кого есть работающий проимер, подскажите, а то совсем плохо...
Сейчас этот форум просматривают: Google-бот, Majestic-12 [Bot], SemrushBot и гости: 14