It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Microsoft Visual Basic 2010 - Variable, Integers HELP!

Moderator: dafunkymunky

Microsoft Visual Basic 2010 - Variable, Integers HELP!

Postby stabby00000 on Tue Nov 29, 2011 10:28 pm

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")
stabby00000
 
Posts: 1
Joined: Tue Nov 29, 2011 10:18 pm

Re: Microsoft Visual Basic 2010 - Variable, Integers HELP!

Postby sanjon on Fri Dec 16, 2011 12:58 pm

Sorry for the late reply.
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
 
Posts: 40
Joined: Sun Dec 05, 2010 6:20 pm


Who is online

Users browsing this forum: No registered users and 4 guests