Hallo Moombas,
auch Dir herzlichen Dank für die Antwort! Vielleicht wird durch meinen Beitrag #5 etwas deutlicher, was ich möchte.
DIe Testwerte sollen nicht in alle in die erste Spalte, das es sich um unterschiedliche Daten handelt (2 Datumswerte und einen €-Wert)
LG Kilo
Ich hätte das dennoch so verstanden:
AutoIt
Opt('MustDeclareVars', 1)
#include <Array.au3>
Global $A_Test[1][3]
Global Const $Bezahlt = 0, $Bestellt = 1, $Preis = 2, $Artikelnummer = 3
Global $col
;Array Init;
_ArrayAdd($A_Test, 'Bezahlt|Bestellt|Preis')
$col = $Bezahlt
If $col > (Ubound($A_Test, $UBOUND_COLUMNS) - 1) then _ArrayColInsert($A_Test ,$col)
For $x = 2 to 3
If $x > (Ubound($A_Test, $UBOUND_ROWS) - 1) then
_ArrayAdd($A_Test, $x, $col)
Else
$A_Test[$x][$col] = $x
EndIf
Next
$A_Test[0][0] = Ubound($A_Test, $UBOUND_ROWS) - 1
$A_Test[0][1] = Ubound($A_Test, $UBOUND_COLUMNS) - 1
_ArrayDisplay($A_Test)
$col = $Bestellt
If $col > (Ubound($A_Test, $UBOUND_COLUMNS) - 1) then _ArrayColInsert($A_Test ,$col)
For $x = 2 to 3
If $x > (Ubound($A_Test, $UBOUND_ROWS) - 1) then
_ArrayAdd($A_Test, $x & ' Stück', $col)
Else
$A_Test[$x][$col] = $x & ' Stück'
EndIf
Next
$A_Test[0][0] = Ubound($A_Test, $UBOUND_ROWS) - 1
$A_Test[0][1] = Ubound($A_Test, $UBOUND_COLUMNS) - 1
_ArrayDisplay($A_Test)
$col = $Preis
If $col > (Ubound($A_Test, $UBOUND_COLUMNS) - 1) then _ArrayColInsert($A_Test ,$col)
For $x = 2 to 3
If $x > (Ubound($A_Test, $UBOUND_ROWS) - 1) then
_ArrayAdd($A_Test, $x & ' €', $col)
Else
$A_Test[$x][$col] = $x & ' €'
EndIf
Next
$A_Test[0][0] = Ubound($A_Test, $UBOUND_ROWS) - 1
$A_Test[0][1] = Ubound($A_Test, $UBOUND_COLUMNS) - 1
_ArrayDisplay($A_Test)
MsgBox(0, 'Bezahlt' , 'Zeile 2 bezahlt: ' & $A_Test[2][$Bezahlt])
MsgBox(0, 'Bestellt', 'Zeile 2 bestellt: ' & $A_Test[2][$Bestellt])
MsgBox(0, 'Preis' , 'Zeile 2 Preis: ' & $A_Test[2][$Preis])
;Oder per Funktion
For $x = 2 to 10
_AddData($Artikelnummer, $x, $x * 2, 'Artikelnummer')
Next
_ArrayDisplay($A_Test)
Func _AddData($Col, $Row, $Data, $Name = '')
If $col > (Ubound($A_Test, $UBOUND_COLUMNS) - 1) then
_ArrayColInsert($A_Test ,$col)
$A_Test[1][$Col] = $Name
EndIf
If $Row > (Ubound($A_Test, $UBOUND_ROWS) - 1) then
_ArrayAdd($A_Test, $Data, $col)
Else
$A_Test[$x][$col] = $Data
EndIf
$A_Test[0][0] = Ubound($A_Test, $UBOUND_ROWS) - 1
$A_Test[0][1] = Ubound($A_Test, $UBOUND_COLUMNS) - 1
EndFunc
Alles anzeigen