This is a discussion on Error in QTP within the Software Testing forums, part of the Testing category; Hi. I am having some problems with the following code. _________________________________________________ Dim Count Dim BankCount BankCount = Int (DataTable.Value("A", dtGlobalSheet)) ...
|
|||||||
| Software Testing Software testing is a process used to identify the correctness, completeness and quality of developed computer software. |
![]() |
| LinkBack | Thread Tools | Search this Thread |
|
|||
|
Hi.
I am having some problems with the following code. _________________________________________________ Dim Count Dim BankCount BankCount = Int (DataTable.Value("A", dtGlobalSheet)) Count = 0 Do until Count = BankCount Count = Count +1 msgbox Count msgbox BankCount wait 1 Loop _________________________________________________ The script runs successfully, however when the scripts Count = Bankcount, the execution cycle is looping back to the beginning of the script, and produces the following error. Error: Type mismatch: '[string: ""]' Details: Line (4): "BankCount = Int (DataTable.Value("A", dtGlobalSheet))". Could someone please tell me: 1 - Why the script loops back to the beginning once Count = BankCount 2 - Why an error is being returned on the above line of code only on the second pass / why no error is returned on the above line of code on the first pass .. ?? Looking forward to seeing your thoughts / suggestions / script alteration recommendations ... thanks - and happy new year |
| Sponsored Links |
|
|||
|
Quote:
|
|
|||
|
Quote:
This code stays in an infinite loop. intNumRows = 1 intMaxRows = DataTable.Value("Test", dtGlobalSheet) MsgBox(intMaxRows) Do Until intNumRows > intMaxRows MsgBox("In Loop: " & intNumRows) intNumRows = intNumRows + 1 Loop This code works fine. intNumRows = 1 intMaxRows = DataTable.Value("Test", dtGlobalSheet) MsgBox(intMaxRows) Do Until intNumRows > 2 MsgBox("In Loop: " & intNumRows) intNumRows = intNumRows + 1 Loop I don't know why the first code stays in an infinite loop. |
|
|||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|