-
August 9th, 2004, 12:58 PM
#1
Select file names
Hi everyone. I'm using a common dialog control to select filenames. The problem is that they must have multiple selection option.
When I try to parse the FileName property I get this weird character "" I dunno what to use to compare this special character. The code follows
files = dlgSelArchivo.FileName
n = Len(files)
For j = 1 To n
char = Mid(files, j, 1)
If char = Null Then
flag = 1
ElseIf char <> Null And flag >= 1 Then
final = final + char
ElseIf char = Null And flag >= 1 Then
final = final + "; "
End If
Next j
Any replies will be appreciated.
Thank You
-
August 9th, 2004, 01:11 PM
#2
If char = Null Then
this is not fine in Vb6
you must code differently:
suppose char is a variant, you can code:
if isEmpty(char) then
in case you did not assigned anithing
or
if isNUll(char) then
in case you read from a db a null field
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 9th, 2004, 01:54 PM
#3
Thanx cimperiali. I'll try that
-
August 9th, 2004, 03:30 PM
#4
Seems to me all that code can be replaced by something like this:
Files = Replace(Files, Chr(1), "; ")
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
August 9th, 2004, 03:32 PM
#5
Well, it didn't work , but I found another way around. I used vbCharNull instead of IsEmpty and it worked
Sometimes MSDN isn't as bad as it looks
Anyway, thanx Cimperiali
-
August 9th, 2004, 03:33 PM
#6
Oh... I was just editing the post and hadn't read your reply WizBang. I think I'll try that
Thanx
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
|