"+" "-" "*" "1" "2" "3" Funktioniert alles, aber sobald ich "%" rein mache, kommt immer eine leere Ergebnis raus.
Hier mal der Script
PHP Code:
; TRechner - Demo
#include <GUIConstants.au3>
GUICreate("Taschen Rechner Created by Divine.", 506, 352, 193, 115)
$input = GUICtrlCreateInput("", 10, 10, 300, 20)
$bnPlus = GUICtrlCreateButton("+", 10, 40, 75, 30)
$bnMinus = GUICtrlCreateButton("-", 85, 40, 75, 30)
$bnDiv = GUICtrlCreateButton("/", 160, 40, 75, 30)
$bnMulti = GUICtrlCreateButton("*", 235, 40, 75, 30)
$bnWurzel = GUICtrlCreateButton("v", 8, 184, 81, 33, 0)
$bn7 = GUICtrlCreateButton("7", 10, 70, 75, 30)
$bn8 = GUICtrlCreateButton("8", 85, 70, 75, 30)
$bn9 = GUICtrlCreateButton("9", 160, 70, 75, 30)
$bnC = GUICtrlCreateButton("C", 235, 70, 75, 60)
$bn4 = GUICtrlCreateButton("4", 10, 100, 75, 30)
$bn5 = GUICtrlCreateButton("5", 85, 100, 75, 30)
$bn6 = GUICtrlCreateButton("6", 160, 100, 75, 30)
$bn1 = GUICtrlCreateButton("1", 10, 130, 75, 30)
$bn2 = GUICtrlCreateButton("2", 85, 130, 75, 30)
$bn3 = GUICtrlCreateButton("3", 160, 130, 75, 30)
$Button1 = GUICtrlCreateButton("%", 8, 312, 97, 33, 30)
$Label1 = GUICtrlCreateLabel("Taschen Rechner was Created by Divine.", 264, 320, 236, 25)
$bnResultat = GUICtrlCreateButton("=", 235, 130, 75, 60)
$bn0 = GUICtrlCreateButton("0", 10, 160, 150, 30)
$bnKoma = GUICtrlCreateButton(",", 160, 160, 75, 30)
$Pic1 = GUICtrlCreatePic(@ScriptDir & '\Bild.jpg', 400, 208, 100, 100)
GUISetState()
While 1
Switch GUIGetMsg()
Case - 3
MsgBox(64, "Viel Spaß", _
"Viel Spaß wünscht euch Divine." & @TAB, 3)
Exit
Case $bnC
GUICtrlSetData($input, "")
Case $bn1
GUICtrlSetData($input, GUICtrlRead($input) & "1")
Case $bn2
GUICtrlSetData($input, GUICtrlRead($input) & "2")
Case $bn3
GUICtrlSetData($input, GUICtrlRead($input) & "3")
Case $bn4
GUICtrlSetData($input, GUICtrlRead($input) & "4")
Case $bn5
GUICtrlSetData($input, GUICtrlRead($input) & "5")
Case $bn6
GUICtrlSetData($input, GUICtrlRead($input) & "6")
Case $bn7
GUICtrlSetData($input, GUICtrlRead($input) & "7")
Case $bn8
GUICtrlSetData($input, GUICtrlRead($input) & "8")
Case $bn9
GUICtrlSetData($input, GUICtrlRead($input) & "9")
Case $bnPlus
GUICtrlSetData($input, GUICtrlRead($input) & " + ")
Case $bnMinus
GUICtrlSetData($input, GUICtrlRead($input) & " - ")
Case $bnDiv
GUICtrlSetData($input, GUICtrlRead($input) & " / ")
Case $bnMulti
GUICtrlSetData($input, GUICtrlRead($input) & " * ")
Case $bn0
GUICtrlSetData($input, GUICtrlRead($input) & "0")
Case $bnKoma
GUICtrlSetData($input, GUICtrlRead($input) & ".")
Case $Button1
GUICtrlSetData($input, GUICtrlRead($input) & "%")
Case $bnWurzel
GUICtrlSetData($input, GUICtrlRead($input) & "v")
Case $bnResultat
GUICtrlSetData($input, Execute(GUICtrlRead($input)))
EndSwitch
WEnd
; Ende