Jump to content

Recommended Posts

Posted

$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?

Posted

From Helpfile, IniReadSection:

"Return Value

Success: Returns a 2 dimensional array where element[n][0] is the key and element[n][1] is the value"

Posted

$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

Posted

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)

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
×
×
  • Create New...