Results 1 to 4 of 4

Thread: AAHHHHH, help in VB6

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Post AAHHHHH, help in VB6

    I need some one that is willing to go through my code and help me clean it up (e.g. Remove any unnecessary code, or simplify code when able.)
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    So post the code!

  3. #3

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    Here ya go.
    Attached Files Attached Files
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  4. #4
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Had a quick look one thing i noticed was you have,

    VB Code:
    1. Public Function CheckPath(Path As String) As String
    2.  
    3.     Path = Trim$(Path)
    4.     If Right$(Path, 1) = "\" Then
    5.         CheckPath = Path
    6.      Else
    7.         CheckPath = Path & "\"
    8.     End If
    9.  
    10. End Function

    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.     Set lnk = New cShellLinkA
    4.     sAppPath = App.Path
    5.     ' in case it's not a root directory
    6.     If Right$(sAppPath, 1) <> "\" Then
    7.         sAppPath = sAppPath & "\"
    8.     End If
    9.     Call ListFiles(CheckPath(App.Path) & "Skin\")
    10.  
    11. End Sub


    and,

    VB Code:
    1. Private Function NormalizePath(sFolder As String) As String
    2.  
    3.     sFolder = Trim$(sFolder)
    4.     If Right$(sFolder, 1) <> "\" Then
    5.         sFolder = sFolder & "\"
    6.     End If
    7.     NormalizePath = sFolder
    8.  
    9. End Function

    Only need one function there.

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