RoscoeT Posted January 15, 2009 Share Posted January 15, 2009 Hello All, Every time I call iniread() I get the default value. My ini file c:\list.ini : [Section1] Key="I love Autoit" $link = IniRead("c:\list.ini","Section1","Key",False) Msgbox(0,"Debug","Result is: " & @CRLF & $link) The msgbox always says "Result it false"; Can anyone please tell me what I am doing wrong here? Thanks a bunch Link to comment Share on other sites More sharing options...
Bert Posted January 15, 2009 Share Posted January 15, 2009 I just tested it. Works for me. Are you sure the ini file is in the right place? Or you have it named wrong? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Aceguy Posted January 15, 2009 Share Posted January 15, 2009 (edited) i would do $inifile="C:\list.ini" if fileextists($inifle)=1 then $link = IniRead($inifile,"Section1","Key",False) Msgbox(0,"Debug","Result is: " & @CRLF & $link) else Msgbox(0,"Test","Error you file was not read",0) endif Edited January 15, 2009 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
RoscoeT Posted January 15, 2009 Author Share Posted January 15, 2009 I just tested it. Works for me. Are you sure the ini file is in the right place? Or you have it named wrong?Thanks for the reply,Very strange. I have double checked and even tried moving the file around.I have re-written the INI section names and key names just to see if I could make a difference... nothing.Any other suggestions?Thanks.R Link to comment Share on other sites More sharing options...
Bert Posted January 15, 2009 Share Posted January 15, 2009 Try this test script and let me know what it does $path = "c:\list.ini" IniWrite($path, "Section1","Key2", "This is some test data") $link = IniRead($path,"Section1","Key2",False) Msgbox(0,"Debug","Result is: " & @CRLF & $link) The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Aceguy Posted January 15, 2009 Share Posted January 15, 2009 (edited) Also try removing the "" from key. [Section1] Key=I love Autoit or.... change the line. $link = IniRead($inifile,"Section1",'Key',False) Edited January 15, 2009 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
RoscoeT Posted January 15, 2009 Author Share Posted January 15, 2009 Thanks for the help but strange results.This code failed to read the file:$inifile="C:\list.ini" if FileExists($inifile)=1 then $link = IniRead($inifile,"Section1","Key",False) Msgbox(0,"Debug","Result is: " & @CRLF & $link) else Msgbox(0,"Test","Error you file was not read",0) endifoÝ÷ Øz0z÷«¶¬r^ÂäyÖ¬{^r×jëh×6$path = "c:\list.ini" IniWrite($path, "Section1","Key2", "This is some test data") $link = IniRead($path,"Section1","Key2",False) Msgbox(0,"Debug","Result is: " & @CRLF & $link)What would cause that? Link to comment Share on other sites More sharing options...
Bert Posted January 15, 2009 Share Posted January 15, 2009 Are there 2 ini files in the root of C:\? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Aceguy Posted January 15, 2009 Share Posted January 15, 2009 IDK c instead of C. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
RoscoeT Posted January 15, 2009 Author Share Posted January 15, 2009 Ah crap!!! I figured it out... Thanks for all your help. The stupid folder had "Hide extensions for known file types" set and the file's real name was list.ini.txt God I hate that "Feature". Sorry for the dumb ass noob stuff. Thanks again guys. 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