Tomb Posted January 31, 2008 Posted January 31, 2008 $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?
whim Posted February 1, 2008 Posted February 1, 2008 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"
Tomb Posted February 1, 2008 Author Posted February 1, 2008 $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
Biohazard Posted February 1, 2008 Posted February 1, 2008 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)
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