Micro Focus QTP (UFT) Forums
Syntax Errors - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Syntax Errors (/Thread-Syntax-Errors)



Syntax Errors - estherindu - 11-20-2009

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



RE: Syntax Errors - basanth27 - 11-20-2009

Check for the End Ifs