Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with my dice game! D8 pls
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ilikeweatherguy




PostPosted: Thu Dec 22, 2011 3:42 pm   Post subject: help with my dice game! D8 pls

hi, im wrking on this dice game and i was just wondering what is wrong with my if statements ,my teacher checked but couldnt find anything and it doesnt work when money equals wager any help would be greatly appreciated thankyou for reading this






Dim L, R, rls, money, wager, total As Single

Private Sub cmdroll_Click()

If wager > money Then 'checks is wager is less than money
lblcantuse.Visible = True
ElseIf money > 0 And wager <= money Then
lblcantuse.Visible = False
lblGameover.Visible = False
wager = Val(txtwager.Text)
money = money - wager
rls = Val(rls) + 1
lblmoney.Caption = money
lblr.Caption = rls

ElseIf money <= 0 Then 'checks is wager is less than money
lblGameover.Visible = True
rls = 0
money = 100
End If

End Sub

Private Sub Form_Load()
'makes all the dice disapear on startup
wager = 0
total = 0
money = 100
rls = 0
imgroll1L.Visible = False
imgroll2L.Visible = False
imgroll3L.Visible = False
imgroll4L.Visible = False
imgroll5L.Visible = False
imgroll6L.Visible = False
imgroll1R.Visible = False
imgroll2R.Visible = False
imgroll3R.Visible = False
imgroll4R.Visible = False
imgroll5R.Visible = False
imgroll5R.Visible = False
imgroll6R.Visible = False
lblGameover.Visible = False
lblr.Caption = rls
lblmoney.Caption = money

End Sub
Sponsor
Sponsor
Sponsor
sponsor
D_homes




PostPosted: Fri Dec 23, 2011 12:56 am   Post subject: Re: help with my dice game! D8 pls

Quote:
If wager > money Then 'checks is wager is less than money


No, that will check if the wager is more than money.Wink I don't have time to read through the rest of your code right now, but that's a start.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: