Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue with strings

Status
Not open for further replies.

bwallens

MIS
Apr 4, 2001
9
US
Hello,
I'm working on a script that checks the last modified date of a file and compares it to the date that was saved last time the script was run. I do this by using StrComp. The problem is that I can never get StrComp to return 0. In other words, the strings are never equal. I've thrown echo statements in key places and the dates look fine. Any ideas?
Maybe an ascii vs. unicode issue? Oh, well.. I'm lost on this one.
Thanks,
Ben
 
Well, here's something that might help --

string1 = "Please work"
string2 = "pLeAsE wOrK"

if (StrComp(cstr(string1), cstr(string2), 1) = 0) then
response.write("I work")
else
response.write("I don't work")
end if

The 1 up there is a constant for VBTextCompare, and makes the comparison case insensitive -- the cstr is just for sanity's sake so you are absolutely sure that whatever you're sending the function is definitely in the correct format --

let me know if that works --
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top