IDebug.WriteLineIf

Syntax

WriteLineIf(Condition: Boolean; Value: Variant);

Parameters

Condition. Condition, which execution displays the value passed in the Value parameter.

Value. Value that should be displayed in the console. To correctly display the value, this parameter should pass simple data types.

Description

The WriteLine method displays a value passed by the Value parameter, moving the cursor to a new line.

Comments

The value is displayed if the Condition condition is satisfied.

Example

Add a link to the MathFin system assembly.

Sub UserProc;
Var
    a, b: Integer;
Begin
    a := Math.RandBetweenI(0100);
    b := Math.RandBetweenI(0100);
    Debug.WriteLine("A=" + a.ToString + "; B=" + b.ToString + " ");
    Debug.WriteLineIf(a < b, "B is greater than A");
    Debug.WriteLineIf(a > b, "A is greater than B");
End Sub UserProc;

After executing the example console window will display the values of two generated numbers and a message, corresponding to the set conditions.

See also:

IDebug