contents   index   previous   next



Clib.assert()

syntax:

Clib.assert(test)

where:

test - boolean flag to determine if the current file name and line number will be displayed and if the script will abort.

 

return:

void.

 

description:

If boolean evaluates to false this function will print the file name and line number to stderr and abort. If the assertion evaluates to true then the program continues. Clib.assert() is typically used as a debugging technique to test assumptions before executing code based on those assumptions. Unlike C, the ScriptEase implementation of assert does not depend upon NDEBUG being defined or undefined; it is always active.

 

see:

Clib.abort()

 

example:

// The Inverse() function below returns

// the inverse of the input number (1/x):

function Inverse(x)

{

   assert(0 != x); 

   return 1 / x; 

}

 


Clib.atexit()