Score Board
Score Board
Score Board
Score Board
Score Board
Score Board Score Board Score Board Score Board Score Board Score Board Score Board Score Board
Score Board Score Board
Score Board
Go Back  Xtreme Visual Basic Talk > > > Score Board


Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2011, 01:26 PM
old_school old_school is offline
Banned
 
Join Date: Jun 2011
Posts: 4
Default Score Board


trying to add in a scoreboard to my program. I'm so tired of working on it im just coding crap at this point. This is what i have now but its way wrong at this point

Code:
Top Part:
Public Class FrmMain1
    Dim arrScore As Integer = 0


The Label/scoreboard defined
Private Sub score_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        If Tries > 0 Then
            "arrScore" Integer += 1
        Else If
            Tries < 1 Then
            "arrScore" Integer = 0
        End If

    End Sub
End Class
Reply With Quote
  #2  
Old 07-06-2011, 02:23 PM
PlausiblyDamp's Avatar
PlausiblyDampScore Board PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Code:
Public Class FrmMain1
    Dim arrScore As Integer = 0


The Label/scoreboard defined
Private Sub score_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        If Tries > 0 Then
            arrScore += 1
        Else If
            Tries < 1 Then
            arrScore = 0
        End If

    End Sub
End Class
should at least compile for you. Not quite sure where you got the syntax you were using from though - I am guessing it wasn't the MSDN library (http://msdn.microsoft.com/en-us/library/9c5t70w2.aspx)
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 07-07-2011, 11:22 AM
passel's Avatar
passelScore Board passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,028
Default

Also, at least in VB 2008 and earlier (didn't try 2010, so won't assume)
Code:
'The Else If expresion needs to be on the same line as the Else If
        Else If
            Tries < 1 Then
            arrScore = 0
        End If

'Needs to be

        ElseIf Tries < 1 Then
            arrScore = 0
        End If
and no space between the "Else" and "If"
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #4  
Old 07-07-2011, 11:30 AM
AtmaWeapon's Avatar
AtmaWeaponScore Board AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

To be fair, I don't think it matters whether the syntax is legal or not. You shouldn't put the condition on a different line than the Else If part. It hurts readability. I've never seen a person do it, and most people expect them on the same line.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Score Board
Score Board
Score Board Score Board
Score Board
Score Board
Score Board Score Board Score Board Score Board Score Board Score Board Score Board
Score Board
Score Board
 
Score Board
Score Board
 
-->