Need Some Help (Newbie) 
Author Message
 Need Some Help (Newbie)

Alright...I've looked over this code a bit. And cant quite figure out why,
it wont work. But...all it is, is a simple little math program, it gives two
random numbers, then the user has to put in the answer...quite easy. It has
two buttons: "New Problem!" And "Check It!" And I hope you can figure out
what these are 'suppose' to do. However.. I caught a snag. If I type in the
correct answer, it will say "Correct Answer" but if I type in the wrong
answer...it says the same this. I think either my If...then...else statement
is messed up..or there is some other way the script needs to be to add two
variables. Please help me. Thanks in advance.

Here's what I got....
--------------------------------------
Public Message1
Public Message2
Public UserName
------------------------------------
Private Sub CommandButton1_Click()
Label1 = Int((20 * Rnd) + 1)
Label3 = Int((20 * Rnd) + 1)
Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
Message2 = "Good Job " & UserName & ", You Got It Right!"
End Sub
------------------------------------
Private Sub CommandButton2_Click()
If TextBox1 = Label3 + Label1 Then
MsgBox Message1
Else
MsgBox Message2
End If
End Sub
----------------------------------
Private Sub Label3_Click()

End Sub
---------------------------------------
Private Sub UserForm_Click()

End Sub
----------------------------------------
Private Sub UserForm_Initialize()
UserName = InputBox("Please Give Me Your Name:")
End Sub



Tue, 17 Dec 2002 03:00:00 GMT  
 Need Some Help (Newbie)
Alright...I got this far...hehe..please bare with me and help. Thanks.
Well I do this script with subtraction no problem.. See I found out that the
script tacks the second number on the end, So...like 12 & 20...would come
out "1220" in the end. which isn't right...it should be "32" because that's
12 + 20.
I know there's a way around this....please...give a minute and help.
I appreciate it.

Quote:
> Alright...I've looked over this code a bit. And cant quite figure out why,
> it wont work. But...all it is, is a simple little math program, it gives
two
> random numbers, then the user has to put in the answer...quite easy. It
has
> two buttons: "New Problem!" And "Check It!" And I hope you can figure out
> what these are 'suppose' to do. However.. I caught a snag. If I type in
the
> correct answer, it will say "Correct Answer" but if I type in the wrong
> answer...it says the same this. I think either my If...then...else
statement
> is messed up..or there is some other way the script needs to be to add two
> variables. Please help me. Thanks in advance.

> Here's what I got....
> --------------------------------------
> Public Message1
> Public Message2
> Public UserName
> ------------------------------------
> Private Sub CommandButton1_Click()
> Label1 = Int((20 * Rnd) + 1)
> Label3 = Int((20 * Rnd) + 1)
> Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
> Message2 = "Good Job " & UserName & ", You Got It Right!"
> End Sub
> ------------------------------------
> Private Sub CommandButton2_Click()
> If TextBox1 = Label3 + Label1 Then
> MsgBox Message1
> Else
> MsgBox Message2
> End If
> End Sub
> ----------------------------------
> Private Sub Label3_Click()

> End Sub
> ---------------------------------------
> Private Sub UserForm_Click()

> End Sub
> ----------------------------------------
> Private Sub UserForm_Initialize()
> UserName = InputBox("Please Give Me Your Name:")
> End Sub



Tue, 17 Dec 2002 03:00:00 GMT  
 Need Some Help (Newbie)
If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then

--
Michael Harris
MVP Scripting


Alright...I got this far...hehe..please bare with me and help. Thanks.
Well I do this script with subtraction no problem.. See I found out that the
script tacks the second number on the end, So...like 12 & 20...would come
out "1220" in the end. which isn't right...it should be "32" because that's
12 + 20.
I know there's a way around this....please...give a minute and help.
I appreciate it.

Quote:
> Alright...I've looked over this code a bit. And cant quite figure out why,
> it wont work. But...all it is, is a simple little math program, it gives
two
> random numbers, then the user has to put in the answer...quite easy. It
has
> two buttons: "New Problem!" And "Check It!" And I hope you can figure out
> what these are 'suppose' to do. However.. I caught a snag. If I type in
the
> correct answer, it will say "Correct Answer" but if I type in the wrong
> answer...it says the same this. I think either my If...then...else
statement
> is messed up..or there is some other way the script needs to be to add two
> variables. Please help me. Thanks in advance.

> Here's what I got....
> --------------------------------------
> Public Message1
> Public Message2
> Public UserName
> ------------------------------------
> Private Sub CommandButton1_Click()
> Label1 = Int((20 * Rnd) + 1)
> Label3 = Int((20 * Rnd) + 1)
> Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It Again!"
> Message2 = "Good Job " & UserName & ", You Got It Right!"
> End Sub
> ------------------------------------
> Private Sub CommandButton2_Click()
> If TextBox1 = Label3 + Label1 Then
> MsgBox Message1
> Else
> MsgBox Message2
> End If
> End Sub
> ----------------------------------
> Private Sub Label3_Click()

> End Sub
> ---------------------------------------
> Private Sub UserForm_Click()

> End Sub
> ----------------------------------------
> Private Sub UserForm_Initialize()
> UserName = InputBox("Please Give Me Your Name:")
> End Sub



Tue, 17 Dec 2002 03:00:00 GMT  
 Need Some Help (Newbie)
Thanks for your help Michael harris...


Quote:
> If CInt(TextBox1) = CInt(Label3) + CInt(Label1) Then

> --
> Michael Harris
> MVP Scripting



> Alright...I got this far...hehe..please bare with me and help. Thanks.
> Well I do this script with subtraction no problem.. See I found out that
the
> script tacks the second number on the end, So...like 12 & 20...would come
> out "1220" in the end. which isn't right...it should be "32" because
that's
> 12 + 20.
> I know there's a way around this....please...give a minute and help.
> I appreciate it.


> > Alright...I've looked over this code a bit. And cant quite figure out
why,
> > it wont work. But...all it is, is a simple little math program, it gives
> two
> > random numbers, then the user has to put in the answer...quite easy. It
> has
> > two buttons: "New Problem!" And "Check It!" And I hope you can figure
out
> > what these are 'suppose' to do. However.. I caught a snag. If I type in
> the
> > correct answer, it will say "Correct Answer" but if I type in the wrong
> > answer...it says the same this. I think either my If...then...else
> statement
> > is messed up..or there is some other way the script needs to be to add
two
> > variables. Please help me. Thanks in advance.

> > Here's what I got....
> > --------------------------------------
> > Public Message1
> > Public Message2
> > Public UserName
> > ------------------------------------
> > Private Sub CommandButton1_Click()
> > Label1 = Int((20 * Rnd) + 1)
> > Label3 = Int((20 * Rnd) + 1)
> > Message1 = "Sorry " & UserName & ", Thats Incorrect. Please Try It
Again!"
> > Message2 = "Good Job " & UserName & ", You Got It Right!"
> > End Sub
> > ------------------------------------
> > Private Sub CommandButton2_Click()
> > If TextBox1 = Label3 + Label1 Then
> > MsgBox Message1
> > Else
> > MsgBox Message2
> > End If
> > End Sub
> > ----------------------------------
> > Private Sub Label3_Click()

> > End Sub
> > ---------------------------------------
> > Private Sub UserForm_Click()

> > End Sub
> > ----------------------------------------
> > Private Sub UserForm_Initialize()
> > UserName = InputBox("Please Give Me Your Name:")
> > End Sub



Tue, 17 Dec 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help needed, urgent-- newbie need GS+GV for PC

2. Need Report to look at SQL Data source ( VB / CR newbie needs help)

3. Newbie needing help badly!! Please help

4. HELP! Newbie needs help with SQL for VB3

5. Please Help Newbie Crystal Report / VB help needed.

6. HELP - Newbie needs help on simple problem!

7. Newbie needs help running help file

8. Help..Newbie needs help with collections...and arrays

9. Ghostscript 8.00 and Redmon - Newbie needs help

10. Newbie needs help: PS to ASCII Text

11. Newbie Need help

12. (Newbie) Help needed

 

 
Powered by phpBB® Forum Software