Announcement

Collapse
No announcement yet.

Automatic Allignment

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatic Allignment

    I am comparing changes in the following file:

    Original File:
    Code:
              
        Using oCon As New SqlConnection
            oCon.ConnectionString = oModConst.Return_Connection_String(System.Configuration.ConfigurationManager.AppSettings("DBConString").ToString())
            oCon.Open()
            If Val(fivedigitSLNo) = 0 Then
                If cust_info.APP_CODE.ToUpper.Trim = "S" Then
                    qry = "SELECT * FROM UserInfo where keyInfo like '%" & KeyStart & Replace(cust_info.key.Trim, "'", "''") & KeyEnd & "%' and saral_slno>0 and  test1_slno=0"
                ElseIf cust_info.APP_CODE.ToUpper.Trim = "T" Then
                    qry = "SELECT * FROM UserInfo where keyInfo like '%" & KeyStart & Replace(cust_info.key.Trim, "'", "''") & KeyEnd & "%' and test1_slno<>0"
                End If
    
            ElseIf cust_info.APP_CODE.ToUpper.Trim = "test" And Val(fivetest1SLNo) < test_sl_Limit Then
                qry = "SELECT * FROM UserInfo where test_slno=" & fivetest1SLNo & " and  test1_slno=0"
            ElseIf cust_info.APP_CODE.ToUpper.Trim = "test1" Then
                If Val(fivetest1SLNo) < test_sl_Limit Then
                    qry = "SELECT * FROM UserInfo where test_slno=" & fivetest1SLNo & " and  test1_slno<>0"
                Else
                    qry = "SELECT * FROM UserInfo where test1_slno=" & fivetest1SLNo
                End If
            End If
            ocmd = New SqlCommand(qry, oCon)
            oData = ocmd.ExecuteReader()
            If oData.HasRows = True Then
                oData.Read()
    Modified File:
    Code:
              
        Using oCon As New SqlConnection
            oCon.ConnectionString = oModConst.Return_Connection_String(System.Configuration.ConfigurationManager.AppSettings("DBConString").ToString())
            oCon.Open()
        'pka cr s
            'If Val(fivedigitSLNo) = 0 Then
            '    If cust_info.APP_CODE.ToUpper.Trim = "test" Then
            '        qry = "SELECT * FROM UserInfo where HD_KeyInfo like '%" & KeyStart & Replace(cust_info.Hd_Key.Trim, "'", "''") & KeyEnd & "%' and test_slno>0 and  tds_slno=0"
            '    ElseIf cust_info.APP_CODE.ToUpper.Trim = "TDS" Then
            '        qry = "SELECT * FROM UserInfo where HD_KeyInfo like '%" & KeyStart & Replace(cust_info.Hd_Key.Trim, "'", "''") & KeyEnd & "%' and tds_slno<>0"
            '    End If
    
            'ElseIf cust_info.APP_CODE.ToUpper.Trim = "test" And Val(fivedigitSLNo) < test_sl_Limit Then
            '    qry = "SELECT * FROM UserInfo where test_slno=" & fivedigitSLNo & " and  test1_slno=0"
            'ElseIf cust_info.APP_CODE.ToUpper.Trim = "test1" Then
            '    If Val(fivetest1SLNo) < test_sl_Limit Then
            '        qry = "SELECT * FROM UserInfo where test_slno=" & fivetest1SLNo & " and  test1_slno<>0"
            '    Else
            '        qry = "SELECT * FROM UserInfo where test1_slno=" & fivetest1SLNo
            '    End If
            'End If
            If Val(commonslno) = 0 Then
                qry = "SELECT * FROM UserInfo where keyInfo like '%" & KeyStart & Replace(cust_info.key.Trim, "'", "''") & KeyEnd & "%' and product='" & cust_info.APP_CODE.Trim & "'"
                ocmd = New SqlCommand(qry, oCon)
                oData = ocmd.ExecuteReader()
            Else
                qry = "SELECT * FROM UserInfo where common_slno=" & commonslno & " and  Product='" & cust_info.APP_CODE.Trim & "'"
                'pka cr
                ocmd = New SqlCommand(qry, oCon)
                oData = ocmd.ExecuteReader()
            End If 'pka cr
            If oData.HasRows = True Then
                oData.Read()
    Beyond Compare Result: Click image for larger version

Name:	BCDefault.png
Views:	46
Size:	88.5 KB
ID:	80966

    Beyond Compare Required Alignment: (manual)
    Click image for larger version

Name:	BCRequired.png
Views:	29
Size:	62.8 KB
ID:	80967
    I have tried Standard alignment,Myers O(ND) alignment,Patience Diff alignment but unable to automatically come to above comparison.

    How can i do so automatically?

    thanks

  • #2
    Thanks for the detailed example set and screenshot workflow. I've reproduced your issue, which is that the Comment part of the lines is throwing off each of our alignment algorithms for this text block. I'll can add these sample files to our use case/test files (if that is ok with you), but can't offer an automated solution for the alignment. The workaround would be to push the alignment manually. In case it helps, you can align entire blocks of code by highlighting multiple lines (on the left), right click -> Align With, and then click and drag (on the right) for the block you want to align it to.
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      Thanks for the detailed example set and screenshot workflow. I've reproduced your issue, which is that the Comment part of the lines is throwing off each of our alignment algorithms for this text block. I'll can add these sample files to our use case/test files (if that is ok with you), but can't offer an automated solution for the alignment. The workaround would be to push the alignment manually. In case it helps, you can align entire blocks of code by highlighting multiple lines (on the left), right click -> Align With, and then click and drag (on the right) for the block you want to align it to.
      Yes , you can add the sample files to your use case/test files, Please reply/respond when you have a automated solution for the alignment. Thank you!

      Comment


      • #4
        Thanks. This isn't a project we'll be able to tackle short term; you would need to use the workaround for your current files.
        Aaron P Scooter Software

        Comment

        Working...
        X