Hallo Leute,
in meiner Listview habe ich mit folgenden Funktionen, Einträge erstellt:
Spoiler anzeigen
Func arraysearch2()
Global $aListe2[1]
$iColumn = _GUICtrlListView_GetColumnCount(GUICtrlGetHandle ($Liste))
$iRow = _GUICtrlListView_GetItemCount(GUICtrlGetHandle ($Liste))
If $iRow > 0 Then
For $i = 0 To $iRow - 1
For $k = 7 To $iColumn -2
$sItem = _GUICtrlListView_GetItemText(GUICtrlGetHandle ($Liste), $i, $k)
For $j = 2 to 2
$sItem2 = _GUICtrlListView_GetItemText(GUICtrlGetHandle ($Liste), $i, $j)
If $sItem <> "" Then
$iArraySearch = _ArraySearch($aListe2, $sItem & $sItem2)
If $iArraySearch = -1 Then
ReDim $aListe2[UBound($aListe2) + 1][4]
$aListe2[UBound($aListe2) - 1][0] = $sItem2
$aListe2[UBound($aListe2) - 1][1] = 1
$aListe2[UBound($aListe2) - 1][2] = "Stk. " & $sItem
$aListe2[UBound($aListe2) - 1][3] = $sItem & $sItem2
Else
$aListe2[$iArraySearch][1] += 1
EndIf
EndIf
Next
Next
Next
_ArraySort($aListe2, 0, 0, 0, 0)
ReDim $aListe2[UBound($aListe2)][3]
$stanz_2 =_Array2D_ToString($aListe2,1,-1,@TAB)
EndIf
EndFunc
Func stk_hinzufuegen2()
FileWrite(@TempDir&"\stanz.txt",$stanz_2)
For $i = 1 To _FileCountLines(@TempDir&"\stanz.txt")
$sText=StringStripWs (StringLeft (FileReadLine (@TempDir&"\stanz.txt",$i),4),8)
$pasteindex = _GUICtrlListView_FindText($ListView1,$sText)
For $j = 1 To _FileCountLines(@TempDir&"\stanz.txt")
$sText2=StringTrimLeft(FileReadLine(@TempDir&"\stanz.txt",$i),4)
_GUICtrlListView_SetItemText(GUICtrlGetHandle($ListView1), $pasteindex,$sText2,2)
Next
Next
FileDelete(@TempDir&"\stanz.txt")
EndFunc
; by BugFix:
Func _Array2D_ToString(ByRef $aArray, $iStart=0, $iEnd=-1, $sDelimItem='|', $sDelimRow=@CRLF)
If Not IsArray($aArray) Then Return SetError(1,0,'')
Local $sOut = '', $iUbound = UBound($aArray)
If $iStart < 0 Or $iStart > $iUbound -1 Then Return SetError(2,0,'')
If $iEnd = -1 Or $iEnd > $iUbound -1 Then $iEnd = $iUbound -1
If $iEnd < $iStart Then Return SetError(3,0,'')
For $i = $iStart To $iEnd
For $j = 0 To UBound($aArray,2) -1
$sOut &= $aArray[$i][$j] & $sDelimItem
Next
$sOut = StringTrimRight($sOut, StringLen($sDelimItem)) & $sDelimRow
Next
Return StringTrimRight($sOut, StringLen($sDelimRow))
EndFunc ;==>_Array2D_ToString
nun habe ich das Problem das bei Stk. (lt.Bild) diese quadratischen ASCII Zeichen kommen anstatt einer leerstelle, warum nur