Softieware Posted July 23, 2009 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.
Developers Jos Posted July 23, 2009 Developers 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.
water Posted July 23, 2009 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Softieware Posted July 23, 2009 Author 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
sksbir Posted July 23, 2009 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
Softieware Posted July 23, 2009 Author Posted July 23, 2009 This problem is solved. Must I close the topic and how can I do this?
water Posted July 23, 2009 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Softieware Posted July 23, 2009 Author 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
Developers Jos Posted July 23, 2009 Developers 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.
Softieware Posted July 23, 2009 Author 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
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