end is used to denote the block of code is complete. A block of code can be zero or more lines of code. Blocks of code are used to gather the workflow of thought together. This means, if I am doing a comparison and the result is true, I could group the workflow for this in a block of code. Also, when you define a procedure of function, it's instructions are in a block of code between begin and end.
// Implementing workflow if A is 1 and B is 2: if (A = 1) AND (B = 2) then begin Writeln('Starting a workflow'); ConnectToDatabase; UpdateSomeInformation; DisconnectFromDatabase; end
Begin writeln('Copyright notice here'); if paramcount=0 then Begin showHelp; Halt; end else Begin showMainMenu; End; end.Source: Reserved Words