Jump to content

Silly little iniread problem, Always returns default


RoscoeT
 Share

Recommended Posts

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 by Aceguy
Link to comment
Share on other sites

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

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

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

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