Micro Focus QTP (UFT) Forums

Full Version: Syntax Errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi ,the below code is giving syntax errors like "Expected Statement","expectd end of statement".but I feel the code is correct.can anyone please double check the code and correct me if am wrong.please solve this ASAP.
Code:
If BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).exist  Then
                intColCount = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).columncount
                msgbox intcolcount
                Set oDesc = Description.Create()
                oDesc("micclass").Value = "Link"
                Dim myarray1()
                Set EditCollection = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).ChildObjects(oDesc)
                NumberOfEdits = EditCollection.Count
                ReDim myarray1(NumberOfEdits)
                If  NumberOfEdits <> 0 Then
                        Reporter.ReportEvent micDone,"Child Objects","No " &strObjClass& "object present in the current Page"
                        'Retrieving the values before Reset button clicked
                        For i = 0 To intColCount
                                If (EditCollection(i).GetROProperty("micclass") = strObjClass) Then
                                                EditCollection(i).click
                                                strFirstRow = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).GetCellData(2,i)
                                                strSecondRow = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).GetCellData(3,i)
                                                intComarision = strComp(strFirstRow,strFirstRow,1)
                                                
                                                If intComarision = "0" then
                                                    Reporter.Reportevent micPass,"Sorting","Values are Eqaul"
    '                                                
                                                        Do
                                                            j = 2
                                                            strFirstRow = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).GetCellData(J,i)
                                                            strSecondRow = BrowserObject.Webtable("micclass:=WebTable","html id:="&strWebtableID).GetCellData(j+1,i)
                                                            intComarision = strComp(strFirstRow,strFirstRow,1)
                                                            j =j+1
                                                        Loop until intComarision = "-1" or intComarision = "1"
                                                    else  If intComarision = -1" Then
                                                    Reporter.Reportevent micPass,"Sorting","Values sorted Ascending Order"
                                                    else if  intComarision = "1" Then
                                                    Reporter.Reportevent micPass,"Sorting","Values sorted Descending Order"
                                                    else
                                                    Reporter.Reportevent micDone,"Sorting","Comparision is failes"&intComarision
                                        End If
                                end if
                            Next
                end if
        end if
Check for the End Ifs