Jump to content

why doesnt this simple iniweite and iniread work?


Tomb
 Share

Recommended Posts

$ck = "cks.ini"

$x = "12"

IniDelete($ck, "section1")
IniWriteSection($ck, "section1", $x)

$om = IniReadSection($ck, "section1")

MsgBox(0, "hi", $om)

i am trying to become more familiar with iniwrite and iniread. i tried to make myself an example code. it writes just fine, but it fails to read, it always reads as 1 in my msgbox. what am i doing wrong?

Link to comment
Share on other sites

$ck = "cks.ini"

$x = "12"

IniDelete($ck, "section1")
IniWriteSection($ck, "section1", $x)

$om = IniReadSection($ck, "section1")

MsgBox(0, "hi", $om)

i am trying to become more familiar with iniwrite and iniread. i tried to make myself an example code. it writes just fine, but it fails to read, it always reads as 1 in my msgbox. what am i doing wrong?

uh so how do i use that?

that is confuse of me

Link to comment
Share on other sites

You're not using IniWriteSection and IniReadSection correctly. They're not very practical if you only want to read/write 1 variable anyway.

Use this instead:

$ck = "cks.ini"

$x = "12"

;IniDelete($ck, "section1") <- not needed because you can rewrite a value without deleting it
IniWrite($ck, "section1", "key1", $x);<- you forgot to state the key

$om = IniRead($ck, "section1", "key1", 0)

MsgBox(0, "hi", $om)
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...