Hello, I am writing a program that can scan an ini file for a list of software. If I have the script look at a populated ini file, it runs fine. When the ini file has no keys or values, I get a subscript error. Can someone look at my code to what I am doing wrong please? ;Check Software.ini file to populate list
$iCount = IniReadSection("C:\Program Files\App\Software.ini", "ApplicationName")
If @error Then
IniWriteSection("C:\Program Files\App\Software.ini", "ApplicationName", "", "")
IniWriteSection("C:\Program Files\App\Software.ini", "Install", "", "")
Sleep(4000)
EndIf
_ArrayDisplay($iCount)
For $i = 1 To $iCount[0][0]
_GUICtrlListView_AddItem($listSoftware, $iCount[$i][0] & " " & $iCount[$i][1])
_GUICtrlListView_AddSubItem($listSoftware, $i, "Scanning...", 1)
_GUICtrlListView_AddSubItem($listSoftware, $i, "Scanning...", 2)
_GUICtrlListView_AddSubItem($listSoftware, $i, "Scanning...", 3)
Next I added the @error because I realised that if there isn't an ini file, the script wouldn't be able to create an array. However, even with a blank ini file, it still doesn't work. This is the error: (52) : ==> Subscript used with non-Array variable.: For $i = 1 To $iCount[0][0] For $i = 1 To $iCount^ ERROR Thanks for any help. Jeff