|
||||||
| Tutorials, Classes and Code Codes, Software, and Classes for download to our registered members. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Welcome, I know that Pascal is not very muched talked about on the forums here much anymore but I think it is a great place to start your programming experiance! Lets begin.
What You Will Need: Pascal Compiler (Just Google "Free Pascal", this is the compiler I use) The will to learn! Your first program: Your first program will be the traditional "Hello World" Program. Here is the information you will need for the making of the program. "Write" command. The write command will do exactly what it sounds like it will do. It will write the text onto the screen! To use it you must use the following format Code:
Write('Put your text here!');
Code:
Program ProgramName; Begin End. Code:
Program HelloWorld; (* The title of the program *)
begin
Write('Hello World'); (* Executable commands *)
end.
Next Lesson: Asking questions to the user and returning the feedback! Last edited by PascalPro; 03-10-2008 at 07:52 PM. Reason: To fix a typo. |
| Sponsored Links |
|
|
|
|||
|
Welcome!
In this lesson we will be teaching you how to ask questions and return feedback. Before we do that you must learn the basics of variables. There are many types of variables : string (A series of characters), integer(between about -30000 to +30000, numbers), and Boolean ( Has two values, true of false) To define variables we must use this format : Code:
var MyName : String; (* Sets the variable 'MyName' as a string *) MyAge : Integer (* Sets the variable 'MyAge as a integer *) AreYouRich : Boolean; (* Sets the variable 'AreYouRich' as a Boolean *) Code:
var MyAge, MomsAge, DadsAge : Integer; Code:
Program CopyCat; var WhatToCopy : String; Code:
Program CopyCat;
var
WhatToCopy : String;
begin
Write('What would you like us to copy? ');
Readln(WhatToCopy);
Code:
Program CopyCat;
var
WhatToCopy : String;
begin
Write('What would you like us to copy? ');
Readln(WhatToCopy);
Writeln(WhatToCopy);
Readln;
End.
Code:
Program Uses; uses crt; var (* All variables here *) begin (* Code goes here *) End. Code:
Program CopyCat;
uses
crt;
var
WhatToCopy : String;
begin
ClrScr; (* Clears screen and makes program easier to read *)
Write('What would you like us to copy? ');
Readln(WhatToCopy);
Writeln(WhatToCopy);
Readln;
End.
Code:
var (* Put Variables Here *) uses crt; Next Lesson Includes : Procedures Happy Programming! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial - ListBox, ComboBox & Command button. | travy92 | VB Tutorials | 9 | 07-05-2008 11:48 PM |
| CodeCall Tutorial Contest #4 | Jordan | Announcements | 29 | 02-25-2008 11:25 AM |
| Tutorial: Visual Studio 2008 Obfuscating with Dotfuscator | Jordan | Tutorials, Classes and Code | 0 | 02-08-2008 02:01 PM |
| John's Java Tutorial Index | John | Java Tutorials | 0 | 01-11-2007 03:05 PM |