First of all thanks for the replies guys, and to try and improve this tut:

Using what we have covered:

Following is a short program written for Pascal that will use some of the things we’ve covered (plus some others, i.e. maths :-O )

Code:
Program UseIt;
{Made by da’dodo}
{This program will take an input and will work out if it is higher or lower than 10, and will write out the factorials of it if lower, 
else will write that many dots on the screen}

Uses
CRT; {As before, the CRT external module}

Var  {Under this section we’re declaring the global variables}
  intInput 			: integer;   {intInput is and integer variable (ie whole numbers)}
  chrQuit			: char; {chrQuit is a character. It can hold only one character, so no essays!!}

Procedure proWriteDots;  {Declare the procedure and give it a name}
{Writes the amount of dots held in variable intInput}
Var  {This is where you declare the local variables}
  i 				: integer;
  intCurrent			: integer;

Begin  {The start of the instructions}

  For i := 1 to intInput  {This loops the commands below up to intInput times – the value of the number the user types in at runtime}
   do

    begin  {The begin allows you to perform multiple instructions within certain functions, such as a for loop or an if statement}

      Write(‘.’);  {Writes a dot, one after the other}

    end {Ends the begin}
  ;  {Ends the for}

End;  {Ends the procedure}

Function fncFactorals {The name of the function, called below}(no : integer {A variable that is passed to the function}) : integer 
 {and the value that is returned}
   ;  {Next thing is this function}
Var
  i				: integer;  {Notice that I’ve used i again. This is commonly used in for loops}
  count				: integer;
  
Begin

  count := 1;  {Initialise the variable count – this sets the starting value, so that an error does not occur later on}

  For i := 1 to no
   do
    count := count * I 
{This is the math I was talking about. Basically it multiplies whatever the value in count was by the number of times the program
has been through the for loop}
  ;

  fncFactorals := count;  {This assigns the final value to the funtion}

End;

Begin  {The start of the main program}
  Repeat {Repeats what follows if the condition at the end is met}
   ClrScr; {Clears the screen}
Writeln(‘Type in a number’);  {Writeln prints stuff to the screen}
Readln(intInput); {This is where the user inputs their value into the program}

If intInput > 10 {Determines if the value is greater than ten}
 
Then 
  
  Begin  {And if it is}
   Writeln(‘The number is bigger than ten, so here’s some dots!!’); {Write this}
   proWriteDots; {And call this procedure}
  end

 else  {If it isn’t greater than 10 }

  Begin
   Writeln(‘The number is less than 10. The factorials are : ‘); {Write this}
   Writeln(fncFactorials(intInput));   {And then write the value this function returns}
  end

;

Writeln(‘Do you want to quit?’);
Readln(chrQuit); {Ask the user if they want to quit}
  Until chrQuit = ‘y’; {And if they do, don’t repeat the loop}
End.
So here’s a step by step to show how it works:
1) First it starts up and finds all the procedures and functions you have entered. It ignores what these do for the moment, but just notes they’re there
2) Then it goes to the main program. It writes some stuff to the screen and asks for an input.
3) When you hit enter, it passes this value through an if statement, to see if it is greater than 10.
a. If it is greater than 10, it calls the procedure proWriteDots. This then loads the variables into memory and writes out a series of dots, the amount of which will be determined by the input you gave.
b. If it is less than 10, it writes the value of function fncFactorals. It does this by passing a value to it (in the brackets) and the function then performs a series of calculations on it, passing the end value back.
4) After it has done one of these two things it asks if the user wants to quit, and if they do, it finishes the loop and exits the program.

And that's pretty much everything we've covered. If there's something specific that anyone is unsure of, just yell and I'll go into more detail/try to explain it better.