y quiero acer una calculadora y no me sale Ayuda por favor:(
Código: Seleccionar todo
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Calculator", 186, 267, 192, 124)
GUISetBkColor(0x000080)
$1 = GUICtrlCreateButton("1", 8, 8, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$2 = GUICtrlCreateButton("2", 64, 8, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$3 = GUICtrlCreateButton("3", 120, 8, 59, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$4 = GUICtrlCreateButton("4", 8, 40, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$5 = GUICtrlCreateButton("5", 64, 40, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$6 = GUICtrlCreateButton("6", 120, 40, 59, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$7 = GUICtrlCreateButton("7", 8, 72, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$8 = GUICtrlCreateButton("8", 64, 72, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$9 = GUICtrlCreateButton("9", 120, 72, 59, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$0 = GUICtrlCreateButton("0", 8, 104, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$mas = GUICtrlCreateButton("+", 64, 104, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Minus = GUICtrlCreateButton("-", 120, 104, 59, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$paranteza1 = GUICtrlCreateButton("(", 8, 136, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$paranteza2 = GUICtrlCreateButton(")", 64, 136, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$x = GUICtrlCreateButton("x", 120, 136, 59, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$linie = GUICtrlCreateButton("/", 8, 168, 51, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$egal= GUICtrlCreateButton("=", 64, 168, 115, 25, $WS_GROUP)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$stergere = GUICtrlCreateButton("Stergere", 8, 200, 171, 25, $WS_GROUP)
GUICtrlSetFont(-1, 10, 800, 0, "Fixedsys")
$Label1 = GUICtrlCreateLabel("ToTal", 8, 236, 40, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
$resultado= GUICtrlCreateInput("", 48, 232, 129, 24)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $1
calcular(1)
Case $2
calcular(2)
Case $3
calcular(3)
Case $4
calcular(4)
Case $5
calcular(5)
Case $6
calcular(6)
Case $7
calcular(7)
Case $8
calcular(8)
Case $9
calcular(9)
Case $0
calcular(0)
Case $mas
calcular('+')
Case $egal
calcular("egal")
Case $stergere
GUICtrlSetData($resultado,"")
EndSwitch
WEnd
Func calcular($num)
If $num = "get" Then
get()
Else
If $num = 'nul' Then
GUICtrlSetData($resultado, GUICtrlRead($resultado) & 0)
Else
GUICtrlSetData($resultado, GUICtrlRead($resultado) & $num)
EndIf
EndIf
EndFunc ;==>calcular