need help with pascal programming

Solution
Whilst that is good advice, there are times when it can be useful to end a program prematurely. The lack of exception handling in Pascal means that this is sometimes better than constructing a convoluted structure. In C this is handled by the "return" statement; the nearest equivalent in Pascal is the "halt" statement.
It's bad form to force a program to end. The proper way is to let it run off the end of it's main procedure after cleaning up after itself.
 
Whilst that is good advice, there are times when it can be useful to end a program prematurely. The lack of exception handling in Pascal means that this is sometimes better than constructing a convoluted structure. In C this is handled by the "return" statement; the nearest equivalent in Pascal is the "halt" statement.
 
Solution