J0ker Posted January 21, 2007 Share Posted January 21, 2007 Hi, I have an ini file to store all infos used in my script. I want to check if all infos were right filled at beginning of my script. Global $Statement = IniRead(@SCRIPTDIR & "\Config.ini", "This", "House", 0) ;Make sure that all settings are OK If $Statement <> "House" <> "Building" <> "Bungalow" Then MsgBox(0,"Error","Statement Error, Make sure to write the right infos in the Config.ini file") Sleep(50) Exit EndIf It's only working for the word House because its the first after the If but for the other words, it's not working. What should I change to this code? The problem dont come from the Ini Read, but from the If statement. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 21, 2007 Developers Share Posted January 21, 2007 If $Statement <> "House" And $Statement <> "Building" And $Statement <> "Bungalow" Then SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
J0ker Posted January 21, 2007 Author Share Posted January 21, 2007 (edited) If $Statement <> "House" And $Statement <> "Building" And $Statement <> "Bungalow" Then Thanks! Is this can be simplified? Global $Level = IniRead(@SCRIPTDIR & "\Config.ini", "Level", "Level", 0) If $Level > 29 then MsgBox(0,"Error","Level Error ") Sleep(50) Exit EndIf If $Level < 0 then MsgBox(0,"Error","Level Error ") Sleep(50) Exit EndIf Edited January 21, 2007 by J0ker Link to comment Share on other sites More sharing options...
Shevilie Posted January 21, 2007 Share Posted January 21, 2007 Global $Level = IniRead(@SCRIPTDIR & "\Config.ini", "Level", "Level", 0) If ($Level > 29) OR ($Level < 0) then MsgBox(0,"Error","Level Error ") Exit EndIf Try this Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
J0ker Posted January 21, 2007 Author Share Posted January 21, 2007 Yep it work, I did not know that the OR statement existed my bad 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