| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Calculator HELP! |
"Visual Boodu .NET" wrote in message
news:...
> **** This is a very simple calculator ****
>
> 1 form, 9 command buttons & 1 text box.
>
> "Nothing to explain really!"
>
> Option Explicit
> Dim RM As Integer
> Dim Action As String
> Dim Other As Integer
>
> Private Sub Command1_Click()
> Action = "+"
> End Sub
>
> Private Sub Command2_Click()
> Action = "-"
> End Sub
>
> Private Sub Command3_Click()
> Action = "/"
> End Sub
>
> Private Sub Command4_Click()
> Action = "*"
> End Sub
>
> Private Sub Command5_Click()
> Text1.Text = 1
> If RM = 0 Then
> RM = Text1.Text
> Else
> Other = Text1.Text
> End If
> End Sub
>
> Private Sub Command6_Click()
> Text1.Text = 2
> If RM = 0 Then
> RM = Text1.Text
> Else
> Other = Text1.Text
> End If
> End Sub
>
> Private Sub Command7_Click()
> Text1.Text = 3
> If RM = 0 Then
> RM = Text1.Text
> Else
> Other = Text1.Text
> End If
> End Sub
>
> Private Sub Command8_Click()
> If Action = "+" Then
> Text1.Text = RM + Other
> ElseIf Action = "-" Then
> Text1.Text = RM - Other
> ElseIf Action = "/" Then
> Text1.Text = RM / Other
> Else
> Text1.Text = RM * Other
> End If
> End Sub
>
> Private Sub Command9_Click()
> RM = 0
> Other = 0
> Text1.Text = ""
> End Sub
**** all right thnx, i tried and it works and i have a more difficult
question
u have 1 label, 10 numbers: 0,1,2,3,4,5,6,7,8,9
- the numbers are commandbuttons
-and you have a button containging the option x!
it is when u enter a number and it multiplies all the number under it
inculding it ex. u enter "5" then it will mutltiply 5*4*3*2*1 but it
doesn't multiply by 0
the question how would you program that button to do that?
-i tried to use a for loop but i wouldn't work
please enter the code with comments so i understand thnx alot!
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com
---
* RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
* RgateImp.MoonDog.BBS at 12/4/02 7:29:39 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)SEEN-BY: 633/267 270 @PATH: 278/230 10/345 379/1 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.