HP 3000 Manuals

ASSERT_HALT [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

ASSERT_HALT 

ASSERT_HALT is an HP Pascal Option.

The ASSERT_HALT compiler option works with the predefined function
assert.  IF an assert fails (that is, if its Boolean expression is
false), and ASSERT_HALT is ON, the program terminates.  If ASSERT_HALT is
OFF, the program continues to execute.  See the HP Pascal/iX Programmer's 
Guide or the HP Pascal/HP-UX Programmer's Guide.

Syntax 

$ASSERT_HALT {ON }$
             {OFF}

Default       OFF

Location      Anywhere.

Example 

This program stops if i is greater than 10.

     $ASSERT_HALT ON$
     $OS 'MPE/iX'$
     PROGRAM show_asserthalt (input,output);
     VAR
        i: integer;
     BEGIN
        write('Please enter an integer: ');
        prompt;
        read(i);
        assert(i<10,99);
        writeln('Good show! You didn''t abort the program.');
     END.



MPE/iX 5.0 Documentation