PDA

Click to See Complete Forum and Search --> : AAHHHHH, help in VB6


New to VB 6
Jun 2nd, 2004, 10:44 PM
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.)

DiGiTaIErRoR
Jun 2nd, 2004, 11:17 PM
So post the code!

New to VB 6
Jun 3rd, 2004, 12:31 AM
Here ya go.

Jmacp
Jun 3rd, 2004, 10:46 AM
Had a quick look one thing i noticed was you have,

Public Function CheckPath(Path As String) As String

Path = Trim$(Path)
If Right$(Path, 1) = "\" Then
CheckPath = Path
Else
CheckPath = Path & "\"
End If

End Function

Private Sub Form_Load()

Set lnk = New cShellLinkA
sAppPath = App.Path
' in case it's not a root directory
If Right$(sAppPath, 1) <> "\" Then
sAppPath = sAppPath & "\"
End If
Call ListFiles(CheckPath(App.Path) & "Skin\")

End Sub


and,

Private Function NormalizePath(sFolder As String) As String

sFolder = Trim$(sFolder)
If Right$(sFolder, 1) <> "\" Then
sFolder = sFolder & "\"
End If
NormalizePath = sFolder

End Function

Only need one function there.