Add function_procedure example
This commit is contained in:
parent
9e0edbb225
commit
60c42da052
22
simple_examples/function_procedure.pas
Normal file
22
simple_examples/function_procedure.pas
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
program function_procedure;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses strutils;
|
||||||
|
|
||||||
|
procedure DisplayMessage(const aMsg: string);
|
||||||
|
begin
|
||||||
|
WriteLn(DupeString('-', Length(aMsg)));
|
||||||
|
WriteLn(aMsg);
|
||||||
|
WriteLn(DupeString('=', Length(aMsg)));
|
||||||
|
end;
|
||||||
|
|
||||||
|
const LazDescription = 'Lazarus is a very powerful IDE';
|
||||||
|
begin
|
||||||
|
DisplayMessage(LazDescription);
|
||||||
|
DisplayMessage('The message above will now be shown backwards.');
|
||||||
|
DisplayMessage(ReverseString(LazDescription));
|
||||||
|
{$IFDEF WINDOWS}
|
||||||
|
ReadLn;
|
||||||
|
{$ENDIF}
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user