WARNING AND NOTICE

All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.

Readmore

Friday, September 24, 2010

pascal delphi programming coding tutorial

maXbox Starter Start with Programming 1.1 First Step To start programming isn’t that difficult. You may know, in the very beginning was nothing which exploded ;)…
To start programming isn’t that difficult. You may know, in the very beginning was nothing which exploded ;). The Starter has been written presuming you don’t have any prior knowledge of programming or software engineering. Coding is sort of a discipline between science and art. In no time we will get deep into maXbox or ObjectPascal programming (OP). It’s just a primer to show the first steps in writing a program. Another lesson goes deeper with a second step and shows objects, classes and events. All you need to know is that in this program, we have a procedure and a function, the procedure is called TestPrimNumbers and it’s purpose is to check numbers if they are prime or not. 1.2 Get the Code When you work with maXbox you will have a sight very similar to the image below. Using Windows or Linux will present some differences but the box is pretty much the same no matter what operating system you are using. The tool is split up into the toolbar across the top, the editor or code part in the centre and the output window at the bottom. The 4 buttons (speed buttons) in the toolbar provide convenient access to the most commonly used functions within the menus “files” and “program”. Before this starter code will work you will need to download maXbox from the website. This can be done from http://www.softwareschule.ch/maxbox.htm (you’ll find the download maxbox2.zip top left on the site). Once the download has finished, unzip the file, making sure that you preserve the folder structure as it is. If you double-click maxbox2.exe the box opens a default program. Test it with F9 or press Compile and you should hear a sound. So far so good now we’ll open our example. 50_program_starter.txt The Load button will present you in /examples with a list of programs stored within your directory as well as a list of /exercises with defective Pascal code to be fixed for training purposes. Alternatively you candownload the file from: http://www.softwareschule.ch/download/50_program_starter.txt Use the Save Page as… function of your browser1 and load it from examples (or wherever you stored it). Now let’s take a look at the code of this project. Our first line is 1 program Primtester_3; A type is essentially a name for a kind of data. When you declare a variable you must specify its type, which determines the set, range and storage of values the variable can hold and the operations that can be performed on it. 13 var 14 mylist: TStringList; //is an object of class TStringList! 15 beforeTime, afterTime: string ; A variable is a place to store data. In this case you are setting up a variable of type string and TStringList. Imagine a variable as a small box (in maXbox;)) where you can keep things. A variable is called a variable because its value can change during the programs execution. But watch out not every name can hold a variable because you can’t use any of OP’s keywords like set, while, case, if then etc as variable names. * * * * Keywords are constants, variables, type and procedure names that are defined as part of the OP language like var or string above. All keywords within the program will appear in bold . * So far we have learned something about library, comments and the difference between a constant and a variable…

Download pascal delphi programming coding tutorial.

0 comments:

Post a Comment