Sign in to follow this  
Followers 0
qwertylol

Iniwritesection

2 posts in this topic

I need to store data from an array into ini.

however, I was not able to understand the readme file completely.

it says the array has to be 2 dimentail, as in

array[n1][n2] and

n2 has to equal to 2,

and then array[n1][0] would equal to the key

and then array[n1][1] would equal to the value.

the array which I an writing the data from is $array[300]

how do I create the 2 dimension array so the the key automatically equal to n1?

as in, I just want the name of the key to equal to the item number of the array.

Share this post


Link to post
Share on other sites



Dim $aData[3] =  [ "FirstValue", "SecondValue", "ThirdValue" ]

;~ $sData = "Key1=Value1" & @LF & "Key2=Value2" & @LF & "Key3=Value3"
$sData = ""
For $i = 0 To UBound($aData) - 1
    $sData &= "Key" & $i+1 & "=" & $aData[$i] & @LF
Next
$sData = StringTrimRight($sData,1)

IniWriteSection("AutoIt-Test.ini", "Section1", $sData)

Share this post


Link to post
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
Sign in to follow this  
Followers 0