Softieware Posted July 23, 2009 Share Posted July 23, 2009 $var1 = 100$var2 = 10;$var1 = IniRead($LogFile, "Schijf defragmenteren", "Defrag", "Niets gevonden");$var2 = IniRead($MyDeDir & "Analyze.ini" ,"Analyze " & "d:", "Fragmented N", "Niet gevonden")If $var2 > $var1 Then MsgBox(0, "yes",$var2 & " > " & $var1,2)Else MsgBox(0, "no",$var2 & " > " & $var1,2)EndIf$var = StringCompare ( $var2 , $var1 )If $var > 0 Then MsgBox(0, "yes", $var2 & " > " & $var1,2)Else MsgBox(0, "no", $var2 & " > " & $var1,2)EndIfWhy works this perfect, but when the $var comes from IniRead it's not working.By the "If <expression> Then statement" its the second $var.Of course I want to do it with the IniRead variables. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2009 Developers Share Posted July 23, 2009 Try: $var1 = Number(IniRead($LogFile, "Schijf defragmenteren", "Defrag", "Niets gevonden")) Mvg Jos 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...
water Posted July 23, 2009 Share Posted July 23, 2009 If i remember correctly IniRead returns strings. There have been numerous discussions on this forum on this subject. The best way I think is to convert the strings returned from iniread to numbers using int or number. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Softieware Posted July 23, 2009 Author Share Posted July 23, 2009 Try:$var1 = Number(IniRead($LogFile, "Schijf defragmenteren", "Defrag", "Niets gevonden"))MvgJosGreat!"It's the little things you must now."Bedankt,mvgWijbe Link to comment Share on other sites More sharing options...
sksbir Posted July 23, 2009 Share Posted July 23, 2009 If i remember correctly IniRead returns strings. There have been numerous discussions on this forum on this subject. The best way I think is to convert the strings returned from iniread to numbers using int or number.If the discussions have been sooo numerous, wouldn't it be a nice idea to improve the iniread function, for example in the way I suggested here ?? Has enhancement suggestion for autoit, I think that iniread should return a variable type in the same kind of the default value.iniread(file,section,variable,0) should return an integeriniread(file,section,variable,"0") should return a stringiniread(file,section,variable,False) should return a boolean Link to comment Share on other sites More sharing options...
Softieware Posted July 23, 2009 Author Share Posted July 23, 2009 This problem is solved. Must I close the topic and how can I do this? Link to comment Share on other sites More sharing options...
water Posted July 23, 2009 Share Posted July 23, 2009 You don't have to but some users alter the title of the topic prepending "[sOVLED]" My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Softieware Posted July 23, 2009 Author Share Posted July 23, 2009 (edited) You don't have to but some users alter the title of the topic prepending "[sOVLED]" Oke, thnks edit: can't edit topic page. Edited July 23, 2009 by Softieware Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2009 Developers Share Posted July 23, 2009 Oke, thnksedit: can't edit topic page.Don't worry... It will get down the list when people give up adding posts to it... 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...
Softieware Posted July 23, 2009 Author Share Posted July 23, 2009 Don't worry... It will get down the list when people give up adding posts to it... I know but it is good to give a (the right) solution en let other people let know that.....Mvg.Wijbe 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