M23 thank you for the help... I thought I understood it ... but i guess I am just not as smart as i thought I was...
Here is what I am trying to do with my Function. No matter what I do i am getting an error. or the output is incomplete.
The error i get is...
Line 554 (File
“D:Usersiasonfish.au3”):
FileWriteLine($fOut, $aPairs[Oj[sij & ‘, “& $aPairs[1][si])
FileWriteLine($fOut. ^ ERROR
Error Array variable has incorrect number of subscripts or subscript
dimension range exceeded.
Global $sFilename = "D:UsersJasonLiveWell.txt"
Func AASS() ; AssocArraySave&Sort
;-- this did not work...
;$fOut = FileOpen($sFilename, 2); maybe change this to a 1 and add a TIME Stamp before the FILE CLOSE
; And populate it
;For $i = 1 To UBound($aList) - 1
; Insert the sorted key
;$aPairs[$i][0] = $aList[$i]
; Insert the associated value
;$aPairs[$i][1] = AssocArrayGet($hipBag, $aList[$i])
;FileWriteLine($fOut, StringQuote($aPairs[0][$i]) & ", " & StringQuote($aPairs[1][$i]))
;_FileWriteLog ($sFilename2, StringQuote($aPairs[0][$i]) & ", " & StringQuote($aPairs[1][$i]))
;Next
;FileClose($fOut)
Global $aArray, $aList
Local $fOut, $I
; Generate list of keys
$aList = AssocArrayKeys($hipBag)
; And sort it
_ArraySort($aList)
; Create an array to hold keys and values
Global $aPairs[UBound($aList)][2]
; And populate it
For $i = 1 To UBound($aList) - 1
; Insert the sorted key
$aPairs[$i][0] = $aList[$i]
; Insert the associated value
$aPairs[$i][1] = AssocArrayGet($hipBag, $aList[$i])
Next
$i = 0
$fOut = FileOpen($sFilename, 2); maybe change this to a 1 and add a TIME Stamp before the FILE CLOSE
; And populate it
For $i = 1 To UBound($aPairs) - 1
FileWriteLine($fOut, ($aPairs[0][$i]) & ", " & ($aPairs[1][$i]))
;_FileWriteLog ($sFilename2, StringQuote($aPairs[0][$i]) & ", " & StringQuote($aPairs[1][$i]))
Next
FileClose($fOut)
EndFunc ;==>AASS