Condividi tramite


ASSERT Command

Displays a message box when a logical expression evaluates to False (.F.).

ASSERT lExpression [MESSAGE cMessageText]

Parameters

  • lExpression
    Specifies the logical expression that is evaluated. If lExpression evaluates to a logical False (.F.), a debugging dialog box is displayed. If lExpression evaluates to a logical True (.T.), the dialog box is not displayed.
  • cMessageText
    Specifies the text displayed in the debugging dialog box. If you omit cMessageText, the default text is displayed, indicating the line number on which the assertion failed and procedure containing the assertion.

Remarks

This command is ignored if the SET ASSERTS command is set to OFF.

The message box contains Cancel, Debug, Ignore and Ignore All buttons. The following table describes the action performed when each button is chosen.

Button Action
Debug Program execution is suspended and the Debugger window is displayed with the Trace window active.
Cancel Program execution is ended.
Ignore Program execution continues with the line following the ASSERT command.
Ignore All Program execution continues with the line following the ASSERT command and ASSERTS is set to OFF. Subsequent ASSERT commands are ignored until ASSERTS is set to ON.

See Also

Debugger Window, | SET ASSERTS | Setting Asserts