| You are here: DEVPPL ‹ Forum ‹ Programming ‹ Visual Basic Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Microsoft Visual Basic 2010 - Variable, Integers HELP!
2 posts
• Page 1 of 1
0
Microsoft Visual Basic 2010 - Variable, Integers HELP!
Hi, Im trying to program a quiz for my coursework in computing at school and I have stored the Scores in a variable. I have coveniently called the variable Score, and I Dim it as Integer.
I need to make an IF statement that says, IF Score is between 1 and 4, then a MsgBox comes up saying you scored 1 - 4. But I dont know how to say IF Score is 1 - 4.
Ive tried:
IF Score = 1 - 4 THEN
MsgBox("You scored 1 - 4")
&
IF Score = 1 or 2 or 3 or 4 THEN
MsgBox("You scored 1 - 4")
&
IF Score = 1 , 2, 3, 4 THEN
MsgBox("You scored 1 - 4")
I need to make an IF statement that says, IF Score is between 1 and 4, then a MsgBox comes up saying you scored 1 - 4. But I dont know how to say IF Score is 1 - 4.
Ive tried:
IF Score = 1 - 4 THEN
MsgBox("You scored 1 - 4")
&
IF Score = 1 or 2 or 3 or 4 THEN
MsgBox("You scored 1 - 4")
&
IF Score = 1 , 2, 3, 4 THEN
MsgBox("You scored 1 - 4")
- Stabby
- Reputation: 0
- Posts: 1
- Joined: Tue Nov 29, 2011 11:18 pm
- Highscores: 0
- Arcade winning challenges: 0
Microsoft Visual Basic 2010 - Variable, Integers HELP! - Sponsored results
- Sponsored results
0
Re: Microsoft Visual Basic 2010 - Variable, Integers HELP!
Sorry for the late reply.
Here is the code:
- Jonas
Here is the code:
- Code: Select all
If Score >= 1 And Score <= 4 Then
MessageBox.Show("You Scored between 1 - 4")
End If
- Jonas
- Sanjon
- Reputation: 0
- Posts: 40
- Joined: Sun Dec 05, 2010 7:20 pm
- Highscores: 0
- Arcade winning challenges: 0
|
|