Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Vokabeltrainer 0.1", 297, 130, 532, 287)
$Label1 = GUICtrlCreateLabel("Vokabel", 56, 16)
$Input1 = GUICtrlCreateInput("Übersetzung", 16, 56, 121, 21)
$Button1 = GUICtrlCreateButton("OK", 16, 88, 121, 25)
$Button2 = GUICtrlCreateButton("Liste anzeigen", 152, 14, 121, 25)
$Button3 = GUICtrlCreateButton("Neue Vokabel", 152, 54, 121, 25)
$Button4 = GUICtrlCreateButton("Sprache", 152, 88, 121, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $temparray[2]
[/autoit] [autoit][/autoit] [autoit]_update()
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_check()
Case $Button2
;_list()
Case $Button3
_new()
Case $Button4
;_lang()
EndSwitch
WEnd
Func _new()
$put = InputBox("Vokabel","Bitte die Vokabel in Deutsch eingeben")
$put2 = InputBox("Vokabel","Übersetzung")
$vokread = IniReadSection("Vok.ini","Vok")
If @error Then
IniWrite("Vok.ini","Vok","Vok",$put & "/" & $put2)
Else
IniWrite("Vok.ini","Vok","Vok" & $vokread[0][0]+1, $put & "/" & $put2)
EndIf
EndFunc
Func _update()
$tok = IniReadSection("Vok.ini","Vok")
$z =Random(2,$tok[0][0],1)
$tak = IniRead("Vok.ini","Vok","Vok" & $z,"")
$tstring = StringSplit($tak,"/")
$z2 = Random(1,2,1)
If $z2 = 1 Then
$k = 2
ElseIf $z2 = 2 Then
$k = 1
EndIf
Global $temparray[0] = $tstring[$z2]
Global $temparay[1] = $tstring[$k]
GUICtrlSetData($Label1,$tstring[$z2])
EndFunc
Func _check()
$vokread = IniReadSection("Vok.ini","Vok")
$r1 = IniRead("Vok.ini","Vok","Vok" & $vokread[0][0]+1,"")
$r2 = StringSplit($r1,"/")
$r3 = GUICtrlRead($Input1)
If $r2 = $temparray[0] Then
If $r3 = $temparray[1] Then
GUICtrlSetData($Label1,"Richtig")
_update()
Else
GUICtrlSetData($Label1,"Falsch")
_update()
EndIf
ElseIf $r2 = $temparray[0] Then
If $r3 = $temparray[1] Then
GUICtrlSetData($Label1,"Richtig")
_update()
Else
GUICtrlSetData($Label1,"Falsch")
_update()
EndIf
EndIf
EndFunc
Sehr unübersichtlich, ich weiß xD
Also, es geht um _update() und _check()...
Bzw. _update funktioniert soweit, aber ich will die Werte aus $tstring für das ganze Script speichern...
Und _check() funktioniert iwie garnicht...