For non-OOP languages, a custom routine is a function, procedure, or subroutine and for pure OOP languages, a custom routine is a class method. Hybrid languages (both non-OOP and OOP) combine both.
Delphi Custom Routines
Delphi is a hybrid language so you can create either class methods (functions and procedures) or you can create global functions and procedures. When a function or procedure is part of a class, it is a class method.
[function/procedure] RoutineName : ReturnType;
As with C++, your custom routine must come before it's first usage or you have to prototype it in the Interface section.
Note: Contrast Delphi with Delphi Prism which is an OOP language (everything is within a class). Both Delphi and Delphi Prism are based on Object Pascal but implement OOP features differently and have some syntax differences too.
Syntax Example:
procedure SayHello(pName: String); begin ShowMessage('Hello ' + pName); end;
function Add(p1, p2 : Double): Double; begin Result := p1 + p2; end;
The following code from a button click event calls the two routines:
procedure TForm2.CustRClick(Sender: TObject); begin SayHello('Mike'); ShowMessage('2+2=' + FloatToStr(Add(2,2))); end;