Jump to content

IniRead problem?


Recommended Posts

Ok well here's my problem, I'm using IniRead to try to get a number from the .ini, and it doesn't work. The program will use the default number from the IniRead function instead, it won't read my number from the acual .ini. I've tried removing default number from the IniRead function and replacing with "" but that still did not work. Here's what I'm trying to do, please help.

$Stat = InputBox("", "Test, enter number")
$Set1 = IniRead("j.FILE", "Character", "Number", 300)

If $Stat < $Set1 Then
MsgBox(0, "Stat", "Number is lower then the number in .ini")
ElseIf $Stat > $Set1 Then
MsgBox(0, "Stat", "Number higher then number in .ini"
EndIf

No matter what I put in the .ini, it will always go based off of 300 since that is the default in the function, I can put 1000 in the .ini, and enter 301 in the input box, and it will say my number is higher then what is in the .ini.

Please help me out here.

~TK

Link to comment
Share on other sites

You want to found out which number is higher. Inpubox() funtion return a string not a interger, so for you to be able to compare which number is higher you need to use NUMBER() function in your if statement.

Example

$Stat = InputBox("", "Test, enter number")

$Set1 = IniRead("j.FILE", "Character", "Number", 300)

If Number($Stat) < Number($Set1) Then

MsgBox(0, "Stat", "Number is lower then the number in .ini")

ElseIf Number($Stat) > Number($Set1) Then

MsgBox(0, "Stat", "Number higher then number in .ini")

EndIf

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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