TestComplete VBA scripting - I want to variablise checking table checkpoints
I have 8 Table Checkpoints( as the code below shows)
I would like to replace this clumsy Select Case End Select with one elegant statement.
I would like to replace the number in the name of the checkpoint with a variable.
e.g. BT_AT_01_Chk_3 becomes BT_AT_01_Chk_varRequestCount
I have been unable to bend the VBA code to my will.
Any ideas/help much appreciated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For varRequestCount = 1 to 8
select case varRequestCount
case 1
Call Tables.BT_AT_01_Chk_1.Check
case 2
Call Tables.BT_AT_01_Chk_2.Check
case 3
Call Tables.BT_AT_01_Chk_3.Check
case 4
Call Tables.BT_AT_01_Chk_4.Check
case 5
Call Tables.BT_AT_01_Chk_5.Check
case 6
Call Tables.BT_AT_01_Chk_6.Check
case 7
Call Tables.BT_AT_01_Chk_7.Check
case 8
Call Tables.BT_AT_01_Chk_8.Check
case else
msgbox " Invalid Request Count: " & varRequestCount
end select
next