|
-
Jul 18th, 2000, 06:33 AM
#1
Thread Starter
Evil Genius
Hi everyone, susspected easy one this.
I am doing a backup app. the user selects a drive from the dirlistbox function, & the resulting directory is put into a text box (which changes with the dirlistbox option selected).
Right, I noticed then, that the textbox does not show a "\" after the text, ie c and not C\.I am using the fso.copyfile method & need that \ in, so Ok I wrote :
TxtBox1.text = Dir1.path & "\" on the dirlistbos click event.
My question, after all of that, is because I get C\\ if the user selects a drive & not a folder. Instead of a very long if-then statement to go through drives a-z, is there another way I can just put in the \ if it's a folder & not a drive?
(Hope I made sense there)
Thank you,
Alex Read
VB6 Learning Edition & SP4

-
Jul 18th, 2000, 06:43 AM
#2
Frenzied Member
Use something like this:
Code:
Function NormalisePath(strPath As String) As String
If Right(strPath, 1) = "\" Then
NormalisePath = strPath
Else
NormalisePath = strPath & "\"
End If
End Function
-
Jul 18th, 2000, 07:07 AM
#3
Thread Starter
Evil Genius
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|