Jump to content
Sign in to follow this  

Ini array?

Recommended Posts


Hi is there a way to write an array value to an ini and when you iniread it, it's still an array value

i really need it to save variable's

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

Share this post

Link to post
Share on other sites

#Include <Array.au3>
MsgBox(0, "Info", "select INI file to write your array variables." & @CRLF & "You can create a new one or open an existing one")
$INIFile = FileOpenDialog("select INI file", "", "INI files (*.ini)", 2+8)
$VarNo = InputBox("No. of variables", "Input how many variables you would like your INI file to remember", "5")
for $i = 1 to $VarNo
    $NewValue=InputBox("New Variable", "Input value for var No. " & $i)
    if @error = 1 then Exit
    IniWrite($INIFile, "Array variables", $i, $NewValue)
MsgBox(0, "Info", "Your INI file with variables has been saved." & @CRLF & @CRLF & " Now you'll need to select INI file to open those" & @CRLF & "variables and arrange them into array")
$SavedFile = FileOpenDialog("select INI file", "", "INI files (*.ini)|Text files (*.txt)|All files (*.*)")
$result = IniReadSection($SavedFile, "Array variables")
dim $AvArray[1]
for $j = 1 to $result[0][0]
    _ArrayAdd($AvArray, $result[$j][1])
_ArrayDisplay($AvArray, "Loaded values from your INI files are:")

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