Page 1 of 3 123 LastLast
Results 1 to 15 of 31

Thread: Testit

  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testit

    <code>

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    <pre>Private Function IsWordComplete(ByVal Txt As String, ByVal Compare As String, ByVal HTML As Boolean) As Boolean
    Txt = Application.Substitute(Txt, " ", "")
    Txt = Application.Substitute(Txt, "<", "")
    Txt = Application.Substitute(Txt, ">", "")
    Txt = Application.Substitute(Txt, Chr$(10), "")
    Txt = Application.Substitute(Txt, Chr$(13), "")
    If (Txt Like "*If*" Or Txt Like "*Else" Or Txt Like "*End*" Or Txt Like "*Const*") And Left$(Txt, 1) = "#" Then
    Txt = Right$(Txt, Len(Txt) - 1)
    End If
    If Txt = Compare Then
    IsWordComplete = True
    ElseIf Left$(Txt, Len(Compare)) = Compare Then
    IsWordComplete = Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 32 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 40 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 41 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 44 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 61
    ' Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 46 Or
    ElseIf Right$(Txt, Len(Compare)) = Compare Then
    IsWordComplete = Asc(Mid$(Txt, 1, 1)) = 32 Or _
    Asc(Mid$(Txt, 1, 1)) = 40 Or _
    Asc(Mid$(Txt, 1, 1)) = 41 Or _
    Asc(Mid$(Txt, 1, 1)) = 44 Or _
    Asc(Mid$(Txt, 1, 1)) = 61
    ' Asc(Mid$(Txt, 1, 1)) = 46 Or
    End If
    End Function
    </pre>


  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Private Function IsWordComplete(ByVal Txt As String, ByVal Compare As String, ByVal HTML As Boolean) As Boolean
    Txt = Application.Substitute(Txt, " ", "")
    Txt = Application.Substitute(Txt, "<", "")
    Txt = Application.Substitute(Txt, ">", "")
    Txt = Application.Substitute(Txt, Chr$(10), "")
    Txt = Application.Substitute(Txt, Chr$(13), "")
    If (Txt Like "*If*" Or Txt Like "*Else" Or Txt Like "*End*" Or Txt Like "*Const*") And Left$(Txt, 1) = "#" Then
    Txt = Right$(Txt, Len(Txt) - 1)
    End If
    If Txt = Compare Then
    IsWordComplete = True
    ElseIf Left$(Txt, Len(Compare)) = Compare Then
    IsWordComplete = Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 32 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 40 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 41 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 44 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 61
    ' Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 46 Or
    ElseIf Right$(Txt, Len(Compare)) = Compare Then
    IsWordComplete = Asc(Mid$(Txt, 1, 1)) = 32 Or _
    Asc(Mid$(Txt, 1, 1)) = 40 Or _
    Asc(Mid$(Txt, 1, 1)) = 41 Or _
    Asc(Mid$(Txt, 1, 1)) = 44 Or _
    Asc(Mid$(Txt, 1, 1)) = 61
    ' Asc(Mid$(Txt, 1, 1)) = 46 Or
    End If
    End Function

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Don't worry, I'm just keeping tabs on you... <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Testit

    But has he completed the cross word..boom boom
    Jerry

  6. #6
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Dunno. It started off like he was trying to write a love letter to someone called 1234, but I can't work out who that might be. Know anyone into encrypting 4-digit numbers?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Testit

    Do you think Alan is in love with a teddy bear?

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> We do have a Lounger named jj1234

  8. #8
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Oh probably. You just can't get the quality of secret service agents these days.

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    <big>While you two have been out <img src=/w3timages/censored.gif alt=censored border=0> around...</big>

    <code><font color=blue>Private</font color=blue> <font color=blue>Function</font color=blue> IsWordComplete(<font color=blue>ByVal</font color=blue> Txt <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> Compare <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> HTML <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>
    Txt = Application.Substitute(Txt, " ", "")
    Txt = Application.Substitute(Txt, "<", "")
    Txt = Application.Substitute(Txt, ">", "")
    Txt = Application.Substitute(Txt, Chr$(10), "")
    Txt = Application.Substitute(Txt, Chr$(13), "")
    <font color=blue>If</font color=blue> (Txt <font color=blue>Like</font color=blue> "*If*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Else" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*End*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Const*") And Left$(Txt, 1) = "#" <font color=blue>Then</font color=blue>
    Txt = Right$(Txt, Len(Txt) - 1)
    <font color=blue>End</font color=blue> <font color=blue>If</font color=blue>
    If Txt = Compare <font color=blue>Then</font color=blue>
    IsWordComplete = <font color=blue>True</font color=blue>
    <font color=blue>ElseIf</font color=blue> Left$(Txt, Len(Compare)) = Compare <font color=blue>Then</font color=blue>
    IsWordComplete = Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 32 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 40 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 41 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 44 Or _
    Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 61
    <font color=448800>' Asc(Mid$(Txt, Len(Compare) + 1, 1)) = 46 Or</font color=448800>
    <font color=blue>Else<font color=blue>If</font color=blue></font color=blue> Right$(Txt, Len(Compare)) = Compare <font color=blue>Then</font color=blue>
    IsWordComplete = Asc(Mid$(Txt, 1, 1)) = 32 Or _
    Asc(Mid$(Txt, 1, 1)) = 40 Or _
    Asc(Mid$(Txt, 1, 1)) = 41 Or _
    Asc(Mid$(Txt, 1, 1)) = 44 Or _
    Asc(Mid$(Txt, 1, 1)) = 61
    <font color=448800>' Asc(Mid$(Txt, 1, 1)) = 46 Or</font color=448800>
    <font color=blue>End</font color=blue> If
    End <font color=blue>Function</font color=blue>
    </code>

  10. #10
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Very pretty! - but don't forget some people have a weird colour sense... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Attached Images Attached Images
    • File Type: gif x.gif (3.1 KB, 0 views)

  11. #11
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Very true (both). I think the value of trying to reproduce the color coding in the VBE interface will depend very much on how people have skinned their lounge display. It looks good in HTML, but can't be displayed (or attached) as such. DOC and RTF look OK too, but this is digressing a long way from the intention.

    Alan
    Attached Files Attached Files

  12. #12
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    <span style="background-color: #FFFF00; color: #000000; font-weight: bold"><code><font color=blue>Private</font color=blue> <font color=blue>Function</font color=blue> IsWordComplete(<font color=blue>ByVal</font color=blue> Txt <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> Compare <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> HTML <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>
    Txt = Application.Substitute(Txt, " ", "")
    Txt = Application.Substitute(Txt, "<", "")
    Txt = Application.Substitute(Txt, ">", "")
    Txt = Application.Substitute(Txt, Chr$(10), "")
    Txt = Application.Substitute(Txt, Chr$(13), "")
    <font color=blue>If</font color=blue> (Txt <font color=blue>Like</font color=blue> "*If*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Else" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*End*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Const*") And Left$(Txt, 1) = "#" <font color=blue>Then</font color=blue>
    </code></span hi>

    More readable? Yes!

    Alan

  13. #13
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    And with a blunder:

    <span style="background-color: #FFFF00; color: #000000; font-weight: bold"><code><font color=blue>Private</font color=blue> <font color=blue>Function</font color=blue> IsWordComplete(<font color=blue>ByVal</font color=blue> Txt <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> Compare <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>, <font color=blue>ByVal</font color=blue> HTML <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>Boolean</font color=blue>
    Txt = Application.Substitute(Txt, " ", "")
    Txt = Application.Substitute(Txt, "<", "")
    Txt = Application.Substitute(Txt, ">", "")
    Txt = Application.Substitute
    <font color=red>(Txt, Chr$(10), "")</font color=red>
    Txt = Application.Substitute(Txt, Chr$(13), "")
    <font color=blue>If</font color=blue> (Txt <font color=blue>Like</font color=blue> "*If*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Else" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*End*" <font color=blue>Or</font color=blue> Txt <font color=blue>Like</font color=blue> "*Const*") And Left$(Txt, 1) = "#" <font color=blue>Then</font color=blue>
    </code></span hi>

  14. #14
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Testit

    Alan, I feel the yellow is a bit of a retina burner, could it be possible to change your code so the highlight is white? My <img src=/S/2cents.gif border=0 alt=2cents width=15 height=15> worth
    Jerry

  15. #15
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testit

    Brilliant idea Jezza!

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>I thought of that as soon as I saw it actually.

    Alan

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •