Results 1 to 18 of 18

Thread: Stupid inherits issue, or not?. [resolved]

Threaded View

  1. #15

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    Re: Stupid inherits issue, or not?.

    Quote Originally Posted by <ABX
    Ah.. i missed the form... (i didnt open the project)

    what i think:

    Not bad...
    You may find using Regular Expressions a better solution for doing this...
    I still would prefer you to use IndexOf (as it is the vb.net way, and it still is using it anyway) (same with mid. (String.Substring)
    You are using Option Explict, Option Strict
    Modulization (splitting code up into classes, blocks) ok, you still do alot in your form.
    Identing: good.

    VB Code:
    1. Private Function isSpace(ByVal var As String) As Boolean
    2.         If var = Chr(32) Then isSpace = True
    3.     End Function
    4.  
    5.     Private Function isLetter(ByRef var As String) As Boolean
    6.  
    7.         If Asc(var) >= 65 And _
    8.             Asc(var) <= 90 Or _
    9.             Asc(var) >= 97 And _
    10.             Asc(var) <= 122 Then
    11.  
    12.             isLetter = True
    13.         End If
    14.  
    15.     End Function

    could be replaced with
    VB Code:
    1. Char.IsLetter("x"c)
    2. Char.IsWhiteSpace("x"c)

    Its pretty good
    IsLetter and IsWhiteSpace was originally for vb6. Thanks for pointing the built in features out.

    As for the regular expressions, a friend wrote a function to do almost the same thing as mine, except it was painfully slow. But it was a good idea at the time. My method is a linear solution that doesn't add overhead. It needs to be as fast as possible because I have to perform this on hundreds of files.

    As for the indexOf, I would, but I am still not sure how to include the CompareMethod parameter. How do I do that again?

    Thanks!
    Last edited by nkad; Feb 3rd, 2005 at 03:07 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width