Fehlermeldung

06/15/2011 21:42 xShizoidx#1
Hallo,

ich habe eine Fehlermeldung, wenn ich mein Script ausführen möchte, jedoch verstehe ich nicht, wo der Fehler liegen soll.

Script :
Code:
#include <File.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("", 620, 657, 182, 144, $WS_POPUP)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 633, 529)
GUICtrlSetData(-1, "")
$Input1 = GUICtrlCreateInput("", 0, 560, 513, 21)
$senden = GUICtrlCreateButton("senden", 528, 560, 75, 25, $WS_GROUP)
$Beenden = GUICtrlCreateButton("Beenden", 528, 608, 75, 25, $WS_GROUP)
$Pic1 = GUICtrlCreatePic("Background.jpg", 0, 520, 636, 360, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)

    Local $sBuffer
    Dim $Text
            Dim $Fragen
            Dim $Antworten
            _FileReadToArray("Antwort.txt","|", $Fragen)
            _FileReadToArray("Frage.txt", "|", $Antworten)

    While (TRUE)
        Switch (GUIGetMsg( ))
               Case $GUI_EVENT_CLOSE
                Exit
            Case $senden
                $sBuffer = GuiCtrlRead($Input1)
                For $i = 1 To UBound($Fragen) - 1
                If $Fragen[$i] = $sBuffer Then
                If StringRegExp ($sBuffer, $Fragen[$i]) Then
                    Local $iRnd = Random(1, 2, 1)
                    Switch $iRnd
                    GUICtrlSetData($Edit1, $Antworten[$i])
                EndIf
                EndIf
        EndSwitch
    WEnd
Könntet ihr mir bitte helfen und mir erzählen, was ich verändert muss, damit es funzt?
06/15/2011 22:12 lolkop#2
Quote:
C:\Users\Administrator\Desktop\test.au3(20,56) : ERROR: _FileReadToArray() called with wrong number of args.
man könnte fast meinen das _FileReadToArray mit einer falschen anzahl von argumenten aufgerufen wurde

Quote:
C:\Users\Administrator\Desktop\test.au3(29,45) : ERROR: $Zeilen: undeclared global variable.
$zeilen wurde auch in der for schleifegenutzt, ohne definiert zu sein.
06/15/2011 22:46 xShizoidx#3
So habe es nochmal überarbeitet, jedoch gibt es immer noch eine Fehlermeldung, obwohl ich doch WEnd auch da habe.

Script :
Code:
#include <File.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form2 = GUICreate("", 620, 657, 182, 144, $WS_POPUP)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 633, 529)
GUICtrlSetData(-1, "")
$Input1 = GUICtrlCreateInput("", 0, 560, 513, 21)
$senden = GUICtrlCreateButton("senden", 528, 560, 75, 25, $WS_GROUP)
$Beenden = GUICtrlCreateButton("Beenden", 528, 608, 75, 25, $WS_GROUP)
$Pic1 = GUICtrlCreatePic("Background.jpg", 0, 520, 636, 360, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)

    Local $sBuffer
	Dim $Text
			Dim $Fragen
            Dim $Antworten
			_FileReadToArray("Antwort.txt", $Fragen)
			_FileReadToArray("Frage.txt", $Antworten)

    While (TRUE)
        Switch (GUIGetMsg( ))
            Case $senden
                $Antworten = GuiCtrlRead($Input1)
				For $i = 1 To UBound($Fragen) - 1
				If $Fragen[$i] = $Antworten Then
                If StringRegExp ($Antworten, $Fragen[$i]) Then
					Local $iRnd = Random(1, 2, 1)
                    Switch $iRnd
                    GUICtrlSetData($Edit1, $Antworten[$i])
				EndSwitch
			EndIf
		EndIf
	 Next
    WEnd
06/15/2011 23:05 Whoknowsit#4
View -> Output

Standardmässig aktiviert. Und dein Code gibt unter Garantie mehr als einen Fehler aus...
06/15/2011 23:16 xShizoidx#5
Ahh dort. Danke.

Alles behoben nun ;)