IDebug.WriteLineIf

Syntax

WriteLineIf(Condition: Boolean; Value: Variant);

Parameters

Condition - condition, which must be satisfied for the value passed as the Value parameter to be displayed.

Value - value, which must be displayed. Simple data types must be passed in this parameter to be displayed correctly.

Description

The WriteLine method displays a value passed by the Value parameter, moving the cursor to a new line if the specified condition is satisfied. The value is displayed if the Condition condition is satisfied. The value is displayed in all the elements, which are contained in the Listeners collection.

Example

Sub Main;

Var

a, b: Integer;

Begin

a := Math.RandBetweenI(0, 100);

b := Math.RandBetweenI(0, 100);

Debug.WriteLine("A=" + a.ToString + " B=" + b.ToString + " ");

Debug.WriteLineIf(a > b, "A is greater than B");

Debug.WriteLineIf(a < b, "B is greater than A");

End Sub Main;

After executing the example the values of two generated numbers and a message, corresponding to the set conditions, will be displayed.

See also:

IDebug

IDebug.Listeners