EXIT Statement

EXIT Statement In Microsoft Dynamics NAV 

EXIT statement is a type of statements that used for skip following program  trigger for avoiding errors or other purpose. Whenever an EXIT statement was there the program quit further moving the codes of that trigger and the control backs to the objects.

For exaple consider the following codes

=============================================

IF Quantity = 0  THEN

  EXIT;

Unit Price := Total Price / Quantity;

=============================================

This statement works in a manner that once the Quantity value will be '0' then the program skip the codes preceding that for avoing the division by zero error.

Related Posts with Thumbnails