السلام عليكم
في كود برنامج الحاسبه
المعروف واللي شفته بالمنتدى هنا بكثره
هناك سؤال اريد اضيفه لمعلوماتي
عندما اجمع اكثر من عدد او اعمل اكثر من عمليه حسابيه بنفس الوقت
مثلا::
2+3+6+5-6-1*2=......
هكذا ... مره وحده.....
لايظهر الناتج الصحيح لان الحسابه لاتدعم هالخاصيه
تجمع او تعمل عمليه حسابيه واحده مثل 2+2
3*5
كيف اعدل على الكود حتى تدعم ذلك :::
هذ الكود المستخدم ::
كيف اعدل وعلى من؟
مشكورين
ياريت الاقي جواب الليله
==============
Dim n1 As Integer Dim n2 As Integer Dim op1 As String Private Sub Command1_Click() Label1.Caption = Label1.Caption + "7" End Sub Private Sub Command10_Click() Label1.Caption = Label1.Caption + "0" End Sub Private Sub Command11_Click() Label1.Caption = Label1.Caption + "." End Sub Private Sub Command12_Click() n1 = Val(Label1.Caption) op1 = "/" Label1.Caption = "" End Sub Private Sub Command13_Click() n1 = Val(Label1.Caption) op1 = "*" Label1.Caption = "" End Sub Private Sub Command14_Click() n1 = Val(Label1.Caption) op1 = "+" Label1.Caption = "" End Sub Private Sub Command15_Click() n1 = Val(Label1.Caption) op1 = "-" Label1.Caption = "" End Sub Private Sub Command16_Click() n2 = Val(Label1.Caption) If op1 = "+" Then Label1.Caption = n1 + n2 Else If op1 = "-" Then Label1.Caption = n1 - n2 Else If op1 = "*" Then Label1.Caption = n1 * n2 Else If op1 = "/" Then Label1.Caption = n1 / n2 End If End If End If End If End Sub Private Sub Command17_Click() If Val(Label1.Caption) > 0 Then Label1.Caption = Sqr(Val(Label1.Caption)) Else MsgBox "áÇíãßä ÇáÍÕæá Úáì ÌÐÑ áÚÏÏ ÓÇáÈ" End If End Sub Private Sub Command18_Click() a = Val(Label1) Label1 = "0" b = 4 End Sub Private Sub Command19_Click() Label1.Caption = Val(Label1.Caption) ^ 2 End Sub Private Sub Command2_Click() Label1.Caption = Label1.Caption + "8" End Sub Private Sub Command20_Click() Label1.BackColor = vbBlack Timer1.Enabled = True End Sub Private Sub Command21_Click() Label1.Caption = "" End Sub Private Sub Command22_Click() Label1.Caption = Val(Label1.Caption) - (Val(Label1.Caption) + Val(Label1.Caption)) End Sub Private Sub Command23_Click() Label1.Caption = Val(Label1.Caption) ^ 3 End Sub Private Sub Command24_Click() Label1.Caption = "3.14159265358979" End Sub Private Sub Command3_Click() Label1.Caption = Label1.Caption + "9" End Sub Private Sub Command4_Click() Label1.Caption = Label1.Caption + "4" End Sub Private Sub Command5_Click() Label1.Caption = Label1.Caption + "5" End Sub Private Sub Command6_Click() Label1.Caption = Label1.Caption + "6" End Sub Private Sub Command7_Click() Label1.Caption = Label1.Caption + "1" End Sub Private Sub Command8_Click() Label1.Caption = Label1.Caption + "2" End Sub Private Sub Command9_Click() Label1.Caption = Label1.Caption + "3" End Sub Private Sub Form_Load() Form1.BackColor = QBColor(9) End Sub Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Form1.BackColor = QBColor(4) If Button = 2 Then Beep End If End If End Sub Private Sub Label1_Click() Label1.BackColor = QBColor(Rnd * 15) End Sub Private Sub Timer1_Timer() from1.WindowState = 1 End End Sub ===============
...؟؟؟؟؟؟؟؟؟؟؟؟
هذا الكود اللي استخدمته
: