|
-
Jul 13th, 2000, 08:04 AM
#1
Thread Starter
Lively Member
I want to compare two strings letter by letter. Why it is to find the filename to get the path. How do I do this??
Using VB6 Still Pluging away
-
Jul 13th, 2000, 08:18 AM
#2
_______
Code:
Option Explict
Option Compare Text
'event code
'StrComp function returns a number...0 if matched, 1 if false
'compare strings to see if you have a matching string or not
'
strMyCompare = StrComp(string1, String2, 1) 'comparison function
If StrMyComp = 0 then
'do bla bla bla because one = two
'do bla bla bla
'or... if false then
Else
'do bla bla bla because one <> Two
End If
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 13th, 2000, 08:30 AM
#3
Thread Starter
Lively Member
Will this return true if only part of the string matches? My problem is that I'm comparing a filename string to a path + filename string. I need to get the full path for the filename. I have a collection that stores the path + filename. I have a list box that contains the filename. I'm using the filename from the list box to compare to the path + filename in the collection. Is there away to just compare
the last part of a string??
Example: C:\AB Directory\TestDir\Mergedfiles.pdf
result = compare "Mergedfiles.pdf" to _
"C:\AB Directory\TestDir\Mergedfiles.pdf"
the result should be yes
Using VB6 Still Pluging away
-
Jul 13th, 2000, 08:37 AM
#4
Fanatic Member
Code:
If strFileName = Right$(strPath, Len(strFileName)) Then
'Bingo!
End If
Iain, thats with an i by the way!
-
Jul 13th, 2000, 08:42 AM
#5
Thread Starter
Lively Member
Using VB6 Still Pluging away
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
|