Sign in to follow this  
Followers 0
TK_Incorperate

IniRead problem?

4 posts in this topic

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

Share this post


Link to post
Share on other sites



I guess it's because you missed the .ini after j.FILE

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I'm not actually using an input box in my real script, I replaced what I am really using for testing purposes, however my problem was that I was an idiot and forgot to put the .ini at the end of the file name, my bad lol.

~TK

Share this post


Link to post
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
Sign in to follow this  
Followers 0