slinger wrote:
Opps, approximately what do you know already? I'll start from there
Lol about that much
(write, writeln, readln)
So variables would be a good place to start.
Offline
Pascal Tutorial #2
---
This is my second pascal tutorial on variables.
To enter variables you must type
var yourVariableHere: Integer; ~ a number anotherVariable: string; ~ a word or text andTheLastOne: boolean; ~ true or false begin yourCodeHere; end;
There are many more types of variables but those are the most commonly used.
---
next: if statements
Edit: these are great tutorials.
Last edited by slinger (2012-01-07 12:48:36)
Offline
Great! The videos you linked to were the ones that I used to get introduced to Pascal and Lazarus. Another thing that would be nice for you to cover are arrays.
Offline
Pascal tutorial #3
---
In this third tutorial I will explain how to use and define arrays.
Defining an array is very similar to defining a variable.
you type
var list:array[1..5]of string; // this is a comment :)
let's break it down.
list ~ name of the array
array ~ defining that it is an array
[1..5] ~ the array can go from the number one to 5
of string ~ the type of array.
To fill an array you simple enter this code
list[1] := 'this is item #1';
Lets's break that down
list ~ name of the array
[1] ~ the location where you are storing the value.
now to reading arrays (this can also be done with variables).
writeln(list[1]);
This will store write out the first value of the array.
---
next : loops
if statements will come after :3
Offline
Pascal Tutorial #4
---
This tutorial is on if statements.
If statements are used for testing whether something in a program.
For example if i am hungry then I will eat an apple else I will not eat an apple.
To write a if statement you type
if condition then begin your code here; end;
to write an if else statement you alter the code so that at the end of the first test there is no ; to indicate an ending.
if condition then begin your code here; end else begin your code here; end;
to write an if and else if tester you use this
if condition then begin code here; end else if condition then begin code here; end;
Well that would be testing in pascal.
---
next: loops
after that: procedures
and after that: functions ~ sorry poopo but i think it should be in order ;P
Offline
I'm learning pascal, i use lazarus too.
Offline
we have lazarus at school, but "computer science" is only possible for the older students
Offline
yeah... but it's not easy to learn it without help
Offline