Wie zählt man 2 labels zoder variablen zusammen?

06/22/2012 15:59 Lufl#1
Hallo,

Ich bräuchte etwas Hilfe wie man 2 variablen, bzw. 2 Labels zusammenzählt.
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Mathetrainer by Timm v1.0.0", 280, 144, 192, 124)
$Label2 = GUICtrlCreateLabel("", 16, 40, 4, 4)
$Label3 = GUICtrlCreateLabel("zahl", 16, 48, 55, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("+", 72, 48, 10, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("zahl", 96, 48, 47, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel("=", 160, 48, 26, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Neue zahl", 16, 72, 113, 17)
$Label1 = GUICtrlCreateLabel("Mathetrainer", 8, 8, 120, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("", 192, 48, 81, 21)
$Button2 = GUICtrlCreateButton("Fertig", 192, 72, 81, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###



While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			$randomzahl1 = randomzahl1()
			GUICtrlSetData($Label3, $randomzahl1)
			$randomzahl2 = randomzahl2()
			GUICtrlSetData($Label5, $randomzahl2)

		
	EndSwitch
WEnd


Func randomzahl1()
	Return Random(1, 100, 1)
EndFunc   ;==>randomzahl1

Func randomzahl2()
	Return Random(1, 100, 1)
EndFunc   ;==>randomzahl1
ich möchte $randomzahl1 und $randomzahl2 zusammenzählen, und ein ergebnis draus machen.
oder $label3 und $label5 zusammenzählen?
wisst ihr wie das geht?
von sowas habe ich leider kene ahnung, und im Internet habe ich danach auch schon gesucht aber nichts gefunden.

lg lufl
06/22/2012 16:26 omer36#2
Quote:
Originally Posted by Lufl View Post
von sowas habe ich leider kene ahnung, und im Internet habe ich danach auch schon gesucht aber nichts gefunden.

lg lufl
lügner.

GUICtrlRead() ist was du brauchst.


PHP Code:
While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            GUICtrlSetData
($Label3randomzahl1())
            
GUICtrlSetData($Label5randomzahl1())
        Case 
$Button2
            GUICtrlSetData
($Input1GUICtrlRead($Label3)+GUICtrlRead($Label5))
    EndSwitch
WEnd


Func randomzahl1
()
    Return 
Random(11001)
EndFunc   ;==>randomzahl1 
06/22/2012 16:33 Lufl#3
Quote:
lügner.
nein kein Lügner, ich habe nach variablen zusammenzählen gesucht, aber nichts richtiges gefunden, nur 2 zahlen zusammenzählen, und texte zusammenfügen.
sonnst würde ich hier ja auch wohl keine frage stellen ;-)

aber danke das du mir geholfen hast, ein Thanks hast du mehr!
06/23/2012 15:55 Lawliet#4
Ein Thread reicht wirklich ;)
Und den Tratsch Thread haben wir auchnoch.
#closed