Page 2 of 2 FirstFirst 12
Results 41 to 47 of 47

Thread: [RESOLVED] Too Many Line Continuations

  1. #41

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Location
    Troon, Scotland
    Posts
    20

    Re: [RESOLVED] Too Many Line Continuations

    Dunno, it's just strange that it would give a continuation error. I'm terrified though incase this happens again lol

  2. #42
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: [RESOLVED] Too Many Line Continuations

    There was a problem character(s) in the frm file that VB couldn't handle. Notepad interpreted it as an EOF and so when I brought the frm file into Norepad it just showed tyhe first half(?) of the file.

  3. #43
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] Too Many Line Continuations

    Quote Originally Posted by Dan_Dan_Man
    Dunno, it's just strange that it would give a continuation error. I'm terrified though incase this happens again lol
    You'll just have to cross the bridge then if/when it happens again


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #44

  5. #45
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] Too Many Line Continuations

    Quote Originally Posted by MartinLiss
    There was a problem character(s) in the frm file that VB couldn't handle. Notepad interpreted it as an EOF and so when I brought the frm file into Norepad it just showed tyhe first half(?) of the file.
    Interesting you mentioned that. Once when I was doing alot of copying and pasting from other sources some of the 'invisible" codes were also copied and pasted in the new VB source code and I played like hell trying to find the errors I was getting. So, I just re-wrote everything from scratch on a new Form (but exactly the same code I was copying that was "visible") and the errors went away.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #46

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Location
    Troon, Scotland
    Posts
    20

    Re: [RESOLVED] Too Many Line Continuations

    Yeah my teacher said the same thing. He couldn't help me at all so that's why I came here

  7. #47
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: [RESOLVED] Too Many Line Continuations

    I could not help but notice that even without the 750KB of null chars your project has over 25000 lines of code. I then notice that the code is constantly repeating itself because each and every player is hardcoded.

    You could possibly store the players and teams in public arrays using a User Defined Type to describe them. Then instead of having hardcoded data you just pass the right variable.

    Code:
    Option Explicit
    
    'Public is the same as Global
    Public Type tPlayer '<-- a user defined type, UDT
        ForeName As String
        Surname As String
        PicPath As String
        Price As Currency 'Long might be better (/10 to display)
        Skill As Integer
        PositionIndex As Integer
        TeamIndex As Integer
        Points As Integer
        Rebounds As Integer
        Assists As Integer
        Total As Integer
        Season As Integer
        Injury As Integer
        Form As Integer
    End Type
    
    Public Type tTeam
        Name As String
        'PlayerIndexes() as Long '<--Could refer back to players
        BigPicPath As String
        SmlPicPath As String
    End Type
    
    Public Players() As tPlayer
    Public Positions() As String
    Public Teams() As tTeam
    Then taking frmPlayerScore as an example you could break down the big select cases down to one sub (your code rearranged)...
    Code:
    Private Sub ShowScore(Player As tPlayer)
        With Player
            frmPlayerScore.Caption = .ForeName & " " & .Surname
            PicPlayer.Picture = LoadPicture(App.Path & .PicPath)
            lblPlayerName.Caption = .ForeName & " " & .Surname
            lblPlayerPrice.Caption = "$" & .Price / 10 & "M"
            lblPlayerPosition.Caption = Positions(.PositionIndex)
            lblPlayerTeam.Caption = Teams(.TeamIndex)
            If scoreprocess Then
                    lblPointsValue.Caption = .Points
                    lblPointsScore.Caption = .Points
                    lblReboundsValue.Caption = .Rebounds / 2
                    lblReboundsScore.Caption = .Rebounds
                    lblAssistsValue.Caption = .Assists / 2
                    lblAssistsScore.Caption = .Assists
                    lblTotalPoints.Caption = CStr(.Points + .Rebounds + .Assists)
                    lblSeasonPoints.Caption = .Season
                    lblGameNumber.Caption = gamenumber
                    
                    If .Injury > 0 Then
                        lblInjuryNumber.ForeColor = vbRed
                        lblInjuryNumber.Caption = .Injury & " week(s) till return"
                    Else
                        lblInjuryNumber.ForeColor = vbGreen
                        lblInjuryNumber.Caption = "Fine"
                    End If
                    
                    If .Form Then 'Form <> 0
                        lblFormBlank.Visible = False
                        lblFormNumber.Caption = .Form
                    Else 'Form = 0
                        lblFormBlank.Visible = True
                        lblFormNumber.Caption = ""
                    End If
                    
                    Select Case .Form
                        Case Is = -2
                            PicForm1.Picture = LoadPicture(App.Path & "\RedArrow.JPG")
                            PicForm2.Picture = LoadPicture(App.Path & "\RedArrow.JPG")
                        Case Is = -1
                            PicForm1.Picture = LoadPicture(App.Path & "\RedArrow.JPG")
                            PicForm2.Picture = LoadPicture(App.Path & "\Black.bmp")
                        Case Is = 0
                            PicForm1.Picture = LoadPicture(App.Path & "\Black.bmp")
                            PicForm2.Picture = LoadPicture(App.Path & "\Black.bmp")
                        Case Is = 1
                            PicForm1.Picture = LoadPicture(App.Path & "\GreenArrow.JPG")
                            PicForm2.Picture = LoadPicture(App.Path & "\Black.bmp")
                        Case Is = 2
                            PicForm1.Picture = LoadPicture(App.Path & "\GreenArrow.JPG")
                            PicForm2.Picture = LoadPicture(App.Path & "\GreenArrow.JPG")
                    End Select
                End If
        End With
    End Sub
    With the original subs looking like this...
    Code:
    Private Sub FowardL_Home_Information()
        If fowardlinfo = True Then
            ShowScore Players(Val(frmMainHome.lblFowardL.Tag)) '<-- a Public variable or a controls Tag could be used to store the index
            fowardlinfo = False
        end if
    End Sub
    Hey presto, frmPlayerScore is 99% smaller and much easier to update.

    This is off topic a bit so if relevant to you it maybe best to reply in a new topic referring back to this.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width