Jump to content

iniread and variable problems


jimmer
 Share

Recommended Posts

hello, I have absolutely no idea on how to associate iniread with variables...

I have no idea how to start it off

$var = IniReadSection("C:\Configurations.ini", "Req")

If @error Then

    MsgBox(4096, "", "Error occured, probably no INI file.")

Else

    For $i = 1 To $var[0][0]

        MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])

    Next

EndIf

If $Req = 1 Then

Sleep(5000)

EndIf

I have no idea how to retrieve the value of the variable... =\

Thanks ~

Link to comment
Share on other sites

Guest Guidosoft

hello, I have absolutely no idea on how to associate iniread with variables...

I have no idea how to start it off

I have no idea how to retrieve the value of the variable... =\

Thanks ~

<{POST_SNAPBACK}>

$Variable = INIRead("File","Section","SPECIFICSETTING!!!","Default text if it don't find nothing")

Don't get it all at once.

Just retrieve from the INI as you need.

Edit: Wait I see what your trying to do. One seccond, i don't know about this.

Edited by Guidosoft
Link to comment
Share on other sites

IniWrite ( "filename", "section", "key", "value" )

you were missing a parametre

read the help file ....

$File = "test.ini"
$Section = "This is a test"
$Key = "Test key"

Iniwrite ($File,$Section,$Key,"Did the test work?")

$work = IniRead ($File,$Section,$Key,"No it didnt")

MsgBox(0, "", $work )

you are reading all the ini at once ... if u just want to read ONE varible use wat i did above ... in ur 1st post.... make sure u actaully have an ini file located in C:\temp\myfile.ini other wise it will say "Error occured" blah blah .. your ini file should look something like

[Section2]
Key1= Did
Key2= This
Key3= Work?
Edited by burrup

qq

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