Jump to content

Recommended Posts

Posted

$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)

EndIf

Why 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.

Posted

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

 

Posted

Try:

$var1 = Number(IniRead($LogFile, "Schijf defragmenteren", "Defrag", "Niets gevonden"))

Mvg

Jos

Great!

"It's the little things you must now."

Bedankt,

mvg

Wijbe

Posted

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 integer

iniread(file,section,variable,"0") should return a string

iniread(file,section,variable,False) should return a boolean

Posted

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

 

Posted (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 by Softieware
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...