I read a txt file (attached) with _FileReadToArray. I am trying to understand how to use this. If I use _ArrayDisplay($aRecords[$x]) it will saw me the 2d array but when I ask for $aRecords[$x][0] or any [3][3] or any else it give me the error "Array variable has incorrect number of subscripts or subscript dimension range exceeded." What do I do wrong? My code #include <file.au3>
#include <Array.au3>
Global $aRecords
Dim $WinSt
Dim $WinEn
;~ FileOpenDialog ( "title", @scriptdir& "\", "EnergiUI (*.dbk"),1)
$File = FileOpenDialog ( "title", @scriptdir& "\", "EnergiUI (*.DBK)",1)
$fName = StringRegExpReplace($File, "^.*\\", "")
If Not _FileReadToArray($File, $aRecords,2,"|") Then
;~ If Not _FileReadToArray($File, $aRecords) Then
MsgBox(4096, @ScriptName, "There was an error reading file!")
Exit
EndIf
For $x = 0 To UBound ($aRecords)-1
if Mod ($x , 10) = 0 Then
_ArrayDisplay($aRecords[$x])
MsgBox(0, "Window", $aRecords[$x])
EndIf
;~ MsgBox(0, "Window", $aRecords[2][4])
;~ If $aRecords[$x][1] = ">matGlassLib" Then
;~ $WinSt = $x
;~ for $y=$x To UBound ($aRecords)-1
;~ If $aRecords[$x][0] = ">" Then
;~ $WinEn = $y
;~ ExitLoop
;~ EndIf
;~ Next
;~ EndIf
;~ MsgBox(0, @ScriptName, $Replaced)
Next
;~ _ArrayDisplay ($aRecords[0])
MsgBox(0, "Window", $WinSt&"-"&$WinEn)Please addvice Materials.dbk