Macht damit was ihr wollt, is mir rotzegal.
Die Inis müssen min. 3 Einträge beinhalten und sollten so aussehen:
Ich spar mir an dieser Stelle das Kompilieren und stell einfach den Source rein:
Danke an... ach diejenigen wissen dass sie gemeint sind oô
Die Inis müssen min. 3 Einträge beinhalten und sollten so aussehen:
Code:
[Vok] Vok=Dump/Dump Vok2=Deutsch/Übersetzung Vok3=Deutsch/Übersetzung ...
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Vokabeltrainer 0.1", 297, 150, 532, 287)
$Label1 = GUICtrlCreateLabel("", 56, 16,100,20)
$Input1 = GUICtrlCreateInput("", 16, 56, 121, 21)
$Button1 = GUICtrlCreateButton("OK/Start", 16, 88, 121, 25)
$Button2 = GUICtrlCreateButton("Liste anzeigen", 152, 14, 121, 25)
$Button3 = GUICtrlCreateButton("Neue Vokabel", 152, 54, 121, 25)
$Label2 = GUICtrlCreateLabel("", 185, 95,100,20)
$Menu = GUICtrlCreateMenu ("Sprache")
$Item = GUICtrlCreateMenuitem ("Sprache ändern",$Menu)
$Item2 = GUICtrlCreateMenuitem ("Hilfe",$Menu)
$Item3 = GUICtrlCreateMenuitem ("Credits",$Menu)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $temparray[1]
Global $tstring
$tmsg = MsgBox(4,"Hilfe anzeigen?","Hilfe anzeigen?")
If $tmsg = 6 Then
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie Ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls Sie anfangs keine geladen haben")
$filea = FileOpenDialog(".ini auswählen",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
Else
$filea = FileOpenDialog(".ini auswählen",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Item
$filea = FileOpenDialog(".ini auswählen",@tempdir,".ini (*.ini)",1)
Global $fileb = StringReplace($filea,"|","/")
_update()
Case $Item2
MsgBox(0,"Hilfe","Bei jedem Start müssen Sie ihre .ini mit den Vokabeln laden" & @crlf & "Diese ist wie folgt aufgebaut:" & @crlf & "[Vok]" & @crlf & "Vok=Dump/Dump" & @crlf & "Vok2=Vokabel1/Übersetzung1" & @crlf & "Vok3=Vokabel2/Übersetzung2" & @crlf & "..." & @crlf & @crlf & "<Neue Vokabel> erstellt einen neuen Eintrag in der geladenen .ini oder erstellt eine neue, falls sie anfangs keine geladen haben")
Case $Item3
MsgBox(0,"Credits","mipez: idea & scripting" & @CRLF & "(c) mipez, 2010")
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_check()
Case $Button2
_list()
Case $Button3
_new()
EndSwitch
WEnd
Func _new()
$put = InputBox("Vokabel","Bitte die Vokabel in Deutsch eingeben")
$put2 = InputBox("Vokabel","Übersetzung")
$vokread = IniReadSection($fileb,"Vok")
If @error Then
MsgBox(0,"Neue .ini", "Es wird eine neue Vok.ini erstellt, bitte Neueingabe wiederholen")
IniWrite($fileb,"Vok","Vok","Dump/Dump")
Else
IniWrite($fileb,"Vok","Vok" & $vokread[0][0]+1, $put & "/" & $put2)
EndIf
EndFunc
Func _list()
$hj = IniReadSection($fileb,"Vok")
_ArrayDisplay($hj)
EndFunc
Func _update()
$tok = IniReadSection($fileb,"Vok")
If not @error Then
$z =Random(2,$tok[0][0],1)
$tak = IniRead($fileb,"Vok","Vok" & $z,"")
$tstring = StringSplit($tak,"/")
$z2 = Random(1,2,1)
If $z2 = 1 Then
$temparray[0] = 1
ElseIf $z2 = 2 Then
$temparray[0] = 2
EndIf
GUICtrlSetData($Label1,$tstring[$z2])
EndIf
EndFunc
Func _check()
$r3 = GUICtrlRead($Input1)
$zt = FileExists($fileb)
If NOT $zt = True Then
MsgBox(0,".ini nicht gefunden","Vok.ini konnte nicht gefunden werden")
Else
If $r3 = "" Then
_update()
Else
If $temparray[0] <> 1 Then
If $r3 = $tstring[1] Then
GUICtrlSetData($Label2,"Richtig!")
GUICtrlSetData($Input1,"")
Sleep(500)
_update()
Else
GUICtrlSetData($Label2,"Falsch!")
EndIf
ElseIf $temparray[0] <> 2 Then
If $r3 = $tstring[2] Then
GUICtrlSetData($Label2,"Richtig!")
GUICtrlSetData($Input1,"")
Sleep(500)
_update()
Else
GUICtrlSetData($Label2,"Falsch!")
EndIf
EndIf
EndIf
EndIf
EndFunc