tmp.html

来自「一个将VB代码转换为html文件的程序!」· HTML 代码 · 共 34 行

HTML
34
字号
<html><body bgcolor=white text=black><pre>
<FONT COLOR='#008800'>'accepts * style wildcards
Function </FONT>acceptExpr(<FONT COLOR='#000088'>ByVal </FONT>strTest, find) <FONT COLOR='#000088'>As </FONT>Boolean
    
    <FONT COLOR='#008800'>'these next 3 lines make it understand diff between</FONT>
    <FONT COLOR='#008800'>'appearing in beginning and end of strings</FONT>
    strTest = Chr(5) &amp; strTest &amp; Chr(5)
    <FONT COLOR='#000088'>If </FONT>Left(find, 1) &lt;&gt; "*" <FONT COLOR='#000088'>Then </FONT>find = Chr(5) &amp; find
    <FONT COLOR='#000088'>If </FONT>Right(find, 1) &lt;&gt; "*" <FONT COLOR='#000088'>Then </FONT>find = find &amp; Chr(5)
    
    <FONT COLOR='#000088'>If </FONT>InStr(find, "*") &gt; 0 <FONT COLOR='#000088'>Then </FONT>tmp = Split(find, "*") _
    <FONT COLOR='#000088'>Else </FONT>push tmp, find
    
    <FONT COLOR='#000088'>Dim </FONT>t <FONT COLOR='#000088'>As </FONT>Integer, f <FONT COLOR='#000088'>As </FONT>Integer
    <FONT COLOR='#000088'>For </FONT>i = 0 To UBound(tmp)
        <FONT COLOR='#000088'>If </FONT>tmp(i) &lt;&gt; <FONT COLOR='#000088'>Empty </FONT>Then
              t = t + 1
              X = InStr(1, strTest, tmp(i), vbTextCompare)
              <FONT COLOR='#000088'>If </FONT>X &gt; 0 <FONT COLOR='#000088'>Then </FONT>f = f + 1
        <FONT COLOR='#000088'>End </FONT>If
    Next
    
    <FONT COLOR='#000088'>If </FONT>(t = f <FONT COLOR='#000088'>And </FONT>t &gt; 0) <FONT COLOR='#000088'>Or </FONT>find = "*" <FONT COLOR='#000088'>Then </FONT>acceptExpr = True
<FONT COLOR='#000088'>End </FONT>Function

<FONT COLOR='#000088'>Sub </FONT>push(ary, value) <FONT COLOR='#008800'>'modifies parent array</FONT>
  <FONT COLOR='#000088'>On Error GoTo </FONT>fresh
    Re<FONT COLOR='#000088'>Dim Preserve </FONT>ary(UBound(ary) + 1)
    ary(UBound(ary)) = value
  <FONT COLOR='#000088'>Exit </FONT>Sub
fresh: Re<FONT COLOR='#000088'>Dim </FONT>ary(0): ary(0) = value
<FONT COLOR='#000088'>End </FONT>Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?