Forum Discussion

ChristopheC's avatar
ChristopheC
Contributor
14 years ago

Do While Loop

Hello,



I use TestComplete 8.70.727 with Vbscript and I have a
strange problem with a "Do While Loop".



The problem is using this :



A = False

B = 0



Do While ((A = False) Or (B < 5))

   A = Regions.<Stores/Region>.Check(<object>)

   B = B + 1

   If (B = 5) Then

     Log.Error("Check Timeout")

   End If

Loop





I skirt the issue with :



Do While Not ((A = True) Or (B > 5))

   A = Regions.<Stores/Region>.Check(<object>)

   B = B + 1

   If (B = 5) Then

     Log.Error("Check Timeout")

   End If

Loop





But I would like to understand where is the problem !





Best Regards



Christophe

3 Replies

  • ASV's avatar
    ASV
    Contributor
    Hello Christophe

    Perhaps problem in this.

    Condition "((A = False) Or (B < 5))" is not equal

    "Not ((A = True) Or (B > 5))".

    It is equal "Not ((A = True) and (B > 5))".
  • Hi Vahagn Bayramyan & Robert Martin,



    Problem in my condition ("Or" instead of "And"  :-( ):



    A = False

    B = 0



    Do While ((A = False) And (B < 5))

       A = Regions.<Stores/Region>.Check(<object>)

       B = B + 1

       If (B = 5) Then

         Log.Error("Check Timeout")

       End If

    Loop





    Thank you



    Christophe