Forum Discussion

hautzenroeder1's avatar
hautzenroeder1
Occasional Contributor
11 years ago

VB Select Case issue

I am optimizing a lot of my If...Then...Else... statements using Select Case. TestComplete supports: Select Case {value}  Case 1 ....  Case 2 ... etc End Select Visual Basic a...
  • TonyMro's avatar
    11 years ago
    This is not a limitation of TestComplete but is instead a limitation of the VBscript language, which is not the same as Visual Basic.



    In the example you provided where value has a range of 1 to 12, you could do the following:



    If (value <= 12) Then

        Select Case value

            Case 11, 12

                ...do something here...

            Case Else

                ...do something here...

        End Select

    Else

        ...do something else...

    End If