|
-
Jun 15th, 2005, 06:39 PM
#1
Thread Starter
Lively Member
-
Jun 15th, 2005, 07:05 PM
#2
Banned
Re: Calculator
That is a broad question. You should have tried to make it, and asked us when you were stuck . Here is some examples of calculators. http://pscode.com/vb/scripts/BrowseC...1=Quick+Search
-
Jun 15th, 2005, 07:07 PM
#3
Re: Calculator
i made an extremely simple calculator in the codebank, under 20 lines of code and actually looks/works like a calculator
-
Jun 17th, 2005, 04:45 PM
#4
Thread Starter
Lively Member
Re: Calculator
well, this is what i end up with, and it still doesn't work! It Pretends that " - Val(Text2.Text) / 4.5" isn't there... can anyone help me?
VB Code:
Private Sub Command1_Click()
If Text1.Text = 2 Then
Label1.Caption = Val(83) - Val(Text2.Text) / 4.5
Else
MsgBox ("Meh...")
End Else
End Sub
-
Jun 17th, 2005, 04:56 PM
#5
-
Jun 17th, 2005, 05:10 PM
#6
Thread Starter
Lively Member
Re: Calculator
lol omfg, but i changed it and it still doesn't work... what now?
-
Jun 17th, 2005, 05:14 PM
#7
-
Jun 17th, 2005, 05:15 PM
#8
Thread Starter
Lively Member
Re: Calculator
yup tht is the problem
-
Jun 17th, 2005, 05:35 PM
#9
-
Jun 19th, 2005, 05:27 PM
#10
Thread Starter
Lively Member
Re: Calculator
nope, even with text in it, it still just shows 83
-
Jun 19th, 2005, 05:42 PM
#11
Addicted Member
Re: Calculator
Hi,
Smart_Phil_dude:
Using your example: I entered 2 in text1, 9 in text2, and I got a result of 81 in label1. It looks like it is working to me there must be something happening elsewhere in your code.
Please note that for your example to change label1 text1 always has to have a 2 in it.
Have a good one!
BK
-
Jun 19th, 2005, 05:58 PM
#12
Thread Starter
Lively Member
Re: Calculator
hmm... but it doesn't do the part "- Val(Text2.text) / 4.5"... it doesn't want to substract the amount in Text2, then divided by 4.5...
-
Jun 19th, 2005, 06:04 PM
#13
Addicted Member
Re: Calculator
Hi,
smart_phil_dude:
According to the order of operations the division will be perfomed first so as in my example of using 9 in text2.
83 - 9 / 4.5
83 - 2
81
if you want the subtraction to be done first then divided use parentheses around subtraction:
(83 - val(text2)) / 4.5
Have a good one!
BK
-
Jun 19th, 2005, 06:12 PM
#14
Thread Starter
Lively Member
Re: Calculator
thnx dude, this is what i put : "((83 - val(text2)) / 4.5)" and it worked... thnx man!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|