This is handy tool to have. When using it I get an error when it tries to read a certain Realtek inf file.
Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.
I emailed him about getting the source, haven't got a reply yet, but since it is made in autoit I was able to decompiled it and get the code. I found the section causing the error and fixed it.
This section is what fails
Local $akey = StringRegExp(@LF & $adata[0], "\n\s*(.*?)\s*=", 3)
Local $avalue = StringRegExp(@LF & $adata[0], "\n\s*.*?\s*=(.*?)\r", 3)
Local $nubound = UBound($akey)
Local $asection[$nubound + 1][2]
$asection[0][0] = $nubound
For $icc = 0 To $nubound - 1
Select
Case StringLeft($akey[$icc], 1) <> ";"
$asection[$icc + 1][0] = $akey[$icc]
$asection[$icc + 1][1] = $avalue[$icc]
EndSelect
Next
What happens is when the $avalue doesnt have the same amount or more as $akey, and there is no check for it. So a simple edit (just 3 added lines) fixes it by simply making sure $avaule has the same or more.
Local $akey = StringRegExp(@LF & $adata[0], "\n\s*(.*?)\s*=", 3)
Local $avalue = StringRegExp(@LF & $adata[0], "\n\s*.*?\s*=(.*?)\r", 3)
Local $nubound = UBound($akey)
Local $nubound2 = UBound($avalue)
Local $asection[$nubound + 1][2]
$asection[0][0] = $nubound
if $nubound <= $nubound2 then
For $icc = 0 To $nubound - 1
Select
Case StringLeft($akey[$icc], 1) <> ";"
$asection[$icc + 1][0] = $akey[$icc]
$asection[$icc + 1][1] = $avalue[$icc]
EndSelect
Next
EndIf
So after that it now runs through all the inf files without erroring out.
If I get permission from him I will be more than happy to put out the updated fix for it, or if he sees this he can put the fix in himself. :-)
-Shane
Last edited by smc1979 (2014-03-19 11:57:52)