Hi,
I'm trying to use IniReadSection from inside of one of my functions and I'm wanting to take each ini key and make it a variable that I can access throughout the script.
$var = IniReadSection("C:\Temp\myfile.ini", "section2")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0][0]
MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
Next
EndIf
Now, obviously "$var[$i][0]" is the key I'm after and I believe I can make it global to everything by doing:
$var = IniReadSection("C:\Temp\myfile.ini", "section2")
If @error Then
MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
For $i = 1 To $var[0][0]
$var_name = $var[$i][0]
$var_value = $var[$i][1]
Global $var_name
;how to set the global $var_name value now?
Next
EndIf
Am I on the right path here?
If so how do I set the value then?