« 2 Corinthians 9:7 | Main| New BlogSphere Image Document »

Comparing StrCompare and @Compare

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

The StrCompare and @Compare are considered 'Language cross-reference' according to Designer Help. When using the compares you should get the following results:

Strings being compared
StrCompare result
@Compare
Either string is NULL
NULL
 
string1 is less than string2
-1
-1
string1 equals string2
0
0
string1 is greater than string2
1
1

Now use the following strings and the results are different. The only character that is different is the special characters.  I would assume that all non number and letters would have the same reults.
String1String2
StrCompare Results
@Compare Results
MailArchivensfMailnsf
-1
-1
MailArchive.nsfMail.nsf
1
-1
MailArchive!nsfMail!nsf
1
-1
MailArchive!nsfMail!nsf
1
-1
MailArchive#nsfMail#nsf
1
-1
MailArchive5nsfMail5nsf
1
1

For now I will be using the following code:

Dim String1 As String, String2 As String
Dim EvalCompare As Variant
Dim CompareResults As Integer
String1 = "MailArchive.nsf"
String2 = "Mail.nsf"
EvalCompare = Evaluate( { @Compare( "} + String1 + {" ; "} + String2 + {" )})
CompareResults = EvalCompare(0)

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)