Hello world pascal tutorial


Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Hello world pascal tutorial

  1. 1. Hello World Pascal Tutorial Nova Southeastern University Cristal Ber ó n-Locke
  2. 2. Obtaining the Software <ul><li>Object Pascal is included on the disk that comes with Learn Pascal with Delphi , written by Warren Rachele. </li></ul><ul><li>The book can be purchased for $49.95 from www.barnesandnoble.com . </li></ul><ul><li>(ISBN 1-55622-719-1) </li></ul>
  3. 3. <ul><li>Before you begin to install, make sure that you exit all windows programs that are currently running. </li></ul>
  4. 4. Installing the Software <ul><li>Place the disk into the CD-Rom drive (in many cases it is the D drive, however this may vary depending on the computer you are using). </li></ul><ul><li>Sometimes the program will begin the installation process on its own. If this happens, skip steps 3, 4, & 5. Instead, go to step 6. </li></ul>
  5. 5. <ul><li>Double click on My Computer on your desktop </li></ul>
  6. 6. <ul><li>Double click on the Object Pascal icon, which should be the same icon as your CD-ROM drive. </li></ul>
  7. 7. <ul><li>Double click on install.exe . </li></ul>
  8. 8. <ul><li>A blue screen will appear and on the left side there will be a message telling you to select a product to install. </li></ul>
  9. 9. <ul><li>Click on the Next button to continue. </li></ul>
  10. 10. <ul><li>Read the Software License Agreement and click on Yes to continue. </li></ul>
  11. 11. <ul><li>Click on Next to continue. </li></ul>
  12. 12. <ul><li>Choose the Typical installation and then click Next . </li></ul><ul><li>After Object Pascal has been installed, restart your computer. </li></ul>
  13. 13. Starting the Program <ul><li>Click on the Start button on the lower left hand side of your screen. </li></ul><ul><li>Go to Programs , then to Delphi, and finally click on Delphi 5. </li></ul>
  14. 14. <ul><li>The program will begin and a screen will appear like the one below. </li></ul>
  15. 15. Building a Template <ul><li>Click on the x on the upper right hand corner of the Form 1 window. </li></ul>
  16. 16. <ul><li>Close the Unit1.pas screen by clicking on the x in the upper right hand corner of the window. </li></ul><ul><li>When asked if you want to save the changes made, click no . </li></ul>
  17. 17. <ul><li>Select Project from the Delphi 1 window and then View Source . </li></ul>
  18. 18. <ul><li>A window will appear titled project project1.dpr. Delete all of the text in that window and type the following. </li></ul><ul><ul><li>program template; </li></ul></ul><ul><ul><li>begin </li></ul></ul><ul><ul><li>end. </li></ul></ul>
  19. 19. <ul><li>Click on File and then Save Project As from the menu at the top of the screen. </li></ul>
  20. 20. <ul><li>Name the file template and leave the extension as .dpr. </li></ul>
  21. 21. <ul><li>Click on Project and then Options from the menu. </li></ul>
  22. 22. <ul><li>Click on the tab called Linker . </li></ul><ul><li>Click on the square that says Generate c onsole application . </li></ul><ul><li>Click on OK . </li></ul>
  23. 23. <ul><li>Click on Project and then Add to Repository from the menu at the top of the screen. </li></ul>
  24. 24. <ul><li>Type in under Title : Console Application </li></ul><ul><li>Type under Description : Template for console application </li></ul><ul><li>Type under Page : Projects </li></ul><ul><li>Type under Author : Your Name </li></ul>
  25. 25. <ul><li>Now in order to confirm that all of the steps have been performed successfully, click on File and then Close All from the menu. </li></ul><ul><li>Select yes to save changes. </li></ul>
  26. 26. <ul><li>Click on File and then New from the menu to bring up the New Items window. </li></ul><ul><li>Click on the tab named Projects , click on Console Applications , and then click OK . </li></ul><ul><li>You are now ready to begin programming! </li></ul>
  27. 27. Hello World Program <ul><li>Type the following into your template window: </li></ul><ul><li>program helloworld; </li></ul><ul><li>begin </li></ul><ul><li>writeln (‘Hello World!’); </li></ul><ul><li>writeln (‘This is my first Pascal program.’); </li></ul><ul><li>readln; </li></ul><ul><li>end. </li></ul>
  28. 28. <ul><li>Click on Run and then Run from the menu at the top of the screen. </li></ul>
  29. 29. <ul><li>Your first program will run on a DOS based screen. </li></ul><ul><li>In order to exit the program, hit any key. </li></ul>
  30. 30. Saving Your Program <ul><li>After all of that work, I have to assume you want to save your work of art! </li></ul><ul><li>Saving your work is important so that you will not have to start over when you return. </li></ul>
  31. 31. <ul><li>Click on File and then Save Project As from the menu at the top of the screen. </li></ul>
  32. 32. <ul><li>A small Save As screen will open. It is waiting for further instructions on what you want to name your design. Type helloworld in the File n ame: box. </li></ul>
  33. 33. Learn More <ul><li>Delphi Object Pascal has a built in Quick Start Tutorial that can be accessed from the Help drop down menu at the top of the screen. </li></ul><ul><li>The tutorial is easy to follow and will guide you on how to create more programs. It will also give you a few more commands that you can try on in your own programs. </li></ul>
  34. 34. Contact Information <ul><li>Cristal Locke can be contacted through e-mail at [email_address] or through </li></ul><ul><li>http://tucker.dade.k12.fl.us/classrooms/Locke/gifted. htm </li></ul><ul><li>This tutorial was created on February 10, 2002. </li></ul>
  35. 35. More Important <ul><li>Have fun trying new programs. </li></ul><ul><li>More codes can be found and downloaded at: </li></ul><ul><li>http://www.dickmann.org/ </li></ul><ul><li>http://www.negifreebee.com/nfbfprg.html </li></ul><ul><li>Maybe one day I will be purchasing one of your home-made programs! </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.