Wolfteeth Posted May 14, 2010 Share Posted May 14, 2010 Hi, Dev Just found a bug for the function Iniread, below is my code: this code will pops up Ini key value, however, when I change the GD.ini file, autoit3 will not reload the INI content until program re-executed. anyone have solution? thanks. $var = IniRead("GD.ini", "A", "Key", "NotFound") MsgBox(4096, "Result", $var) While 1 Sleep(Random(2000,5000,1)) MsgBox(4096, "Result", $var) IniWrite("GD.ini", "A", "Key", "test") WEnd Below is the GD.ini file: [A] Key=US Key=UK [C] Key=INDIA Link to comment Share on other sites More sharing options...
DW1 Posted May 14, 2010 Share Posted May 14, 2010 The bug is in your code, not autoit. You declared $var before the loop and never change the contents of $var again no matter how many times it loops. You need to ReRead the Ini (or just re set the variable) if you wish to get an updated value. MsgBox(4096, "Result", IniRead("GD.ini", "A", "Key", "NotFound")) While 1 Sleep(Random(2000,5000,1)) MsgBox(4096, "Result", IniRead("GD.ini", "A", "Key", "NotFound")) IniWrite("GD.ini", "A", "Key", "test") WEnd AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Wolfteeth Posted May 14, 2010 Author Share Posted May 14, 2010 (edited) Sorry, it's my fault....my exact code is not same as above code.. when I just debug my original source code agian and found the possible reason that it is not INI didn't be reload but the IENavigate didn't refresh.... many thanks...pls close/cancel the topic... Edited May 14, 2010 by Wolfteeth 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