Search Tools Links Login

Domain change in progress, site content is moving! See this post for more info

Better App.Path Function

Visual Basic 6, or VB Classic

App.Path returns a string with the "\" character at the end if the path is the root drive (e.g., "C:\") but without that character if it isn't (e.g., "C:\Program Files"). Most of the time we need the "\" at the end, so this function saves you the inconvenience of adding it every time.

Public Function AppPath() As String

    Dim sAns As String
    sAns = App.Path
    If Right(App.Path, 1) <> "\" Then sAns = sAns & "\"
    AppPath = sAns

End Function

About this post

Posted: 2007-05-03
By: FortyPoundHead
Viewed: 2,389 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

Sorry. Comments are frozen for this article. If you have a question or comment that relates to this article, please post it in the appropriate forum.