VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3345
   ClientLeft      =   6330
   ClientTop       =   4935
   ClientWidth     =   3870
   LinkTopic       =   "Form1"
   ScaleHeight     =   3345
   ScaleWidth      =   3870
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   480
      Left            =   120
      TabIndex        =   1
      Top             =   2760
      Width           =   3615
   End
   Begin VB.TextBox Text1 
      Height          =   2535
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   0
      Top             =   135
      Width           =   3615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
    Text1.Text = "A 256 8" & vbCrLf & "B 512 14" & vbCrLf & "C 512 28" & vbCrLf & "D 1024 60"
End Sub

Private Sub Command1_Click()

    Dim straryTxtBoxText() As String
    Dim intLoopCounter As Integer
    Dim intPreviousAddedNos As Integer
    Dim intCurrentAddedNos As Integer
    Dim strHighestLine As String
    Dim strTrimedCurrentElement As String
    
    straryTxtBoxText = Split(Text1.Text, vbCrLf)
    
    For intLoopCounter = 0 To UBound(straryTxtBoxText)
    
        strTrimedCurrentElement = Trim(straryTxtBoxText(intLoopCounter))
        strTrimedCurrentElement = Mid(strTrimedCurrentElement, InStr(strTrimedCurrentElement, " ") + 1)
    
        intCurrentAddedNos = CInt(Left(strTrimedCurrentElement, InStr(strTrimedCurrentElement, " ") - 1)) + _
        CInt(Right(strTrimedCurrentElement, InStrRev(strTrimedCurrentElement, " ") - 3))
    
        If intCurrentAddedNos > intPreviousAddedNos Then
            intPreviousAddedNos = intCurrentAddedNos
            strHighestLine = Left(Trim(straryTxtBoxText(intLoopCounter)), 1)
        End If
    
    Next intLoopCounter

    MsgBox "The Highest Vlued Line is: " & strHighestLine

End Sub


