You must learn to crawl before you can walk, or run.
Here are some resources to get you started:
http/www.taoyue.com/tutorials/pascal
http
/www.exam.gr/pascal/Docs/tutorial1/intro.html
http
/www.tutorialspoint.com/pascal/
As to your initial question. It's extremely bad form to force a program to end abruptly. A proper design has the program returning to the main subroutine (where everything started) for final clean up and exit. The resources I linked will help guide you through this.