TestPlan while
Document

while

by Group Public on Sunday April 25 2010 @ 21:57:06 (1/1 Points)

Language ↪Reference ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It

while loops on a block of code so long as a given condition remains true.

Syntax

while condition
  # code
end

The condition will be checked at the beginning of each loop. If the evaluation is true the code will be executed. If the evaluation is false the code will not be executed and the loop will stop.

Any of the standard conditions may be used.

continue

Anywhere within the code the keyword continue may be used to skip the remaining code and return to the evaluation step. This is useful within if statements.

while is %More%
  ...
  if ! strMatches %SomeValue% .*abc
    continue
  end
  ...
end

break

Anywhere within the code the keyword break may be used to skip the remaining code and terminate the loop -- the condition will not be checked again.

while is %More%
  ...
  if eqString %Value% DONE
    break
  end
  ...
end
© 2008-2010 edA-qa mort-ora-y
Using Persephone and TestPlan
Tag: