abrogard Posted June 29, 2019 Share Posted June 29, 2019 (edited) Why is this string comparison saying they are not equal? ; Set the working directory if not there now. Local $sCurrentDir $sCurrentdir = @CRLF & @WorkingDir ; Display the working directory. MsgBox($MB_SYSTEMMODAL, "", " 2 The current working directory: " & $sCurrentDir) Local $sStr1 = $sCurrentDir Local $sStr2 = "E:\AUTOITWORK" ; Compare two strings without using case sensitivity. Local $iCmp = StringCompare($sStr1, $sStr2) MsgBox($MB_SYSTEMMODAL, "", _ "Comparing " & $sStr1 & " To " & $sStr2 & @CRLF & _ "StringCompare Result (mode $STR_NOCASESENSE): " & $iCmp) If $sCurrentDir <> "E:\AUTOITWORK" Then MsgBox($MB_SYSTEMMODAL, "", " NOT correct directory: ") FileChangeDir("E:\AUTOITWORK") MsgBox($MB_SYSTEMMODAL, "", "Just changed the dir") EndIf ahhh... i've made a little progress. strlen says one is 13 chars where the other is 15 chars. what to do next? ahh.. I have used StringStripWS to make two stripped vars which then compare as the same. So it was whitespace. Thank you for the venue to help me work through it... Edited June 29, 2019 by abrogard Earthshine 1 Link to comment Share on other sites More sharing options...
mikell Posted June 29, 2019 Share Posted June 29, 2019 So you found that adding a leading @crlf makes the string different and longer by 2 white space chars. Nice. Apart from this great discovery what is the purpose of this totally useless topic ? Exit and FrancescoDiMuro 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now