DelphiScript - If, Case and Loop Operations

Applies to TestComplete 14.91, last modified on July 20, 2021

In DelphiScript you can use the if operator in the same way as in Delphi. There are no restrictions on it. The same is true for the loop operators: for, while and repeat...until.

The case operator has a bit wider functionality than in Delphi. Blessedly, it can be used for any types including strings. For instance, the following code is correct:


case Sys.Desktop.ActiveWindow.WndCaption of
  'Find' : Log.Message('The Find dialog');
  'Replace' : Log.Message('The Replace dialog');
  Log.Warning('Unexpected window');

See Also

DelphiScript Description

Highlight search results