Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
VERIFY Macro
                                              Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  VERIFY( booleanExpression );
 
  Parameter   Description
 
  <exp>       An expression (including pointer values) that evaluates to
              TRUE or FALSE.
 
  Remarks
 
  In the Debug version of the Microsoft Foundation class library, the
  VERIFY macro evaluates its argument. If the result is FALSE, the macro
  prints a diagnostic message and halts the program. If the condition is
  TRUE, it does nothing.
 
  The diagnostic message has the form:
 
      assertion failed in file <name> in line <num>
 
  where <name> is the name of the source file and <num> is the line number
  of the assertion that failed in the source file.
 
  In the Release version of the Microsoft Foundation class library, VERIFY
  evaluates the expression but does not print or interrupt the program.
  For example, if the expression is a function call, the call will be
  made.
 
  Example
 
  CFile f;
  VERIFY( f.Open( "file.dat", CFile::modeCreate | CFile::modeWrite ) );
  // Terminates program if Open fails; always executes Open
 
 
  See Also
 
  ASSERT
 
 
                                     -♦-