WriteIf(Condition: Boolean; Value: Variant);
Condition. Condition, execution of which 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.
The WriteIf method displays a value passed by the Value parameter without moving the cursor to a new line.
The value is displayed if the Condition condition is satisfied.
Add a link to the MathFin system assembly.
Sub UserProc;
Var
a, b: Integer;
Begin
a := Math.RandBetweenI(0, 100);
b := Math.RandBetweenI(0, 100);
Debug.Write("A=" + a.ToString + " B=" + b.ToString + " ");
Debug.WriteIf(a > b, "A is greater than B");
Debug.WriteIf(a < b, "B is greater than A");
End Sub UserProc;
After executing the example the values of two generated numbers and a message, corresponding to the set conditions, will be displayed.
See also: