Цитата FlatX007:
как мне вытащить из этого массива что либо ? »
|
Код:
$sIniFile = @DesktopDir & '\File.ini'
$aSectNames = IniReadSectionNames($sIniFile)
If Not IsArray($aSectNames) Then Exit MsgBox(16, 'Error', 'No Sections found (or file does not exists).')
Dim $aAllSections[$aSectNames[0] + 1]
$aAllSections[0] = $aSectNames[0]
For $i = 1 To $aSectNames[0]
$aCurrentSection = IniReadSection($sIniFile, $aSectNames[$i])
If Not @error Then
$aCurrentSection[0][1] = $aSectNames[$i]
$aAllSections[$i] = $aCurrentSection
EndIf
Next
;Вытаскиваем данные из массива массивов :)...
For $j = 1 To $aAllSections[0]
;Получаем массив из N-ого элемента общего массива (содержит массив в каждом элементе)
$aCurrentSection = $aAllSections[$j]
;Печатаем имя секций, которое содержится в первом элементе второго измерения (это двумерный массив)
ConsoleWrite("[" & $aCurrentSection[0][1] & "]" & @CRLF)
;Печатаем все ключи и их значения
For $x = 1 To $aCurrentSection[0][0]
ConsoleWrite($aCurrentSection[$x][0] & "=" & $aCurrentSection[$x][1] & @CRLF)
Next
ConsoleWrite(@CRLF)
Next