Edit: Explizit? Garnicht. Aber wenn kein Fehler kommt muss er gedrückt worden sein.
In der Hilfe steht:
1 = The Cancel button was pushed.
2 = The Timeout time was reached.
3 =
The InputBox failed to open. This is usually caused by bad arguments.
4 = The
InputBox cannot be displayed on any monitor.
5 = Invalid parameters width
without height or left without top.
Ok hat keinen Errorcode, sondern ist immer, wenn @error=0 ist.
Wenn ichs richtig gedeutet habe dürfte das hier das sein, was du haben willst:
AutoIt
#include<Array.au3>
Global $GRetoure[20][2]
ScanPZN($GRetoure)
Exit
Func ScanPZN(ByRef $arGRetoure)
local $width=400,$height=105
$hGui=GUICreate("Erfassungsmaske",$width,$height)
GUICtrlCreateLabel("Tippen Sie die PZN ein und drücken Sie auf OK oder scannen Sie die Artikel ab. Korrekturen können später vorgenommen werden!",5,5,$width-10,35)
$inputNumber=GUICtrlCreateInput("",5,$height-65,$width-10,25)
GUICtrlSendMsg(-1, 0x1501, 0, "Menge * PZN")
$buttonOK=GUICtrlCreateButton("OK",5,$height-35,($width-10)/2)
$buttonCancel=GUICtrlCreateButton("Fertig",10+($width-15)/2,$height-35,($width-15)/2)
GUISetState()
local $count=0
while 1
$msg=GUIGetMsg()
Switch $msg
Case $buttonOK
$arRes=StringRegExp(GUICtrlRead($inputNumber),"(^((?:(?:[0-9]+)(?:-*))+)$)|(?:^([0-9]+)(?:\W*?)\*(?:\W*?)((?:(?:[0-9]+)(?:-*))+)$)",3)
;_ArrayDisplay($arRes)
if UBound($arRes)=4 then
$arGRetoure[$count][0]=int($arRes[2])
$arGRetoure[$count][1]=int(StringReplace($arRes[3], "-",""))
Elseif UBound($arRes)=2 then
$arGRetoure[$count][0]=1
$arGRetoure[$count][1]=int(StringReplace($arRes[0], "-", ""))
Else
MsgBox(16,"Error","Eingabe fehlerhaft!")
EndIf
_ArrayDisplay($arGRetoure)
$count+=1
if $count=UBound($arGRetoure) then
ReDim $arGRetoure[UBound($arGRetoure)+20][2]
endif
Case $buttonCancel
ExitLoop
Case -3
ExitLoop
EndSwitch
WEnd
ReDim $arGRetoure[$count][2]
_ArrayDisplay($arGRetoure)
EndFunc
Alles anzeigen
(Code in den Code Tags ist angenehmer! :))
MfG Kanashius