Faalamva Posted November 18, 2017 Posted November 18, 2017 (edited) Hello, A strange behaviour occured in my code, so I've stripped and stripped again its content, until I could confine and identify the very cause of the malfunction. Put under its simplest form, here it is : this kind of comparison is working, although at first sight it's no so evident why it is : If "338a" = 338 Then MsgBox(0, "", "Why oh why ?") EndIf I understand that comparing a string with an integer is a bit odd, however in the original code, I'm comparing variables from an array, and this array if filled from an Excel file through the _Excel_RangeRead function. The column of the Excel file can contain random values : some of them are 338 (interpreted as integer) and some others are 338a (interpreted as string). Now I can solve the problem by forcing the comparison like this : String(variable1) = String(variable2) where variable1 and variable2 can be of any type (coming from the Excel file). However I'd like to know the very reason why this comparison is working in the first place ? Please enlighten me ! Faalamva Edited November 18, 2017 by Faalamva
jchd Posted November 18, 2017 Posted November 18, 2017 Use == instead of = This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Faalamva Posted November 18, 2017 Author Posted November 18, 2017 20 minutes ago, jchd said: Use == instead of = Thank you, I could find this very useful thread (with all the explanations) thanks to your hint : https://www.autoitscript.com/forum/topic/98970-and/ As far as I'm concerned, this topic can now be closed.
jchd Posted November 18, 2017 Posted November 18, 2017 Sorry I didn't have much time for lengthy explanation. Nice to know you've got it. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
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