Argh, I couldn't find a simple example on the web. So, without further ado:

hello.dpr

program hello;
{$apptype console}
uses greet;

var
  index: cardinal;
  name:  string;
begin
if ParamCount > 0
  then for index := 1 to ParamCount do
         Salute( ParamStr( index ) )
  else begin
       Write( 'What is your name? ' );
       ReadLn( name );
       Salute( name )
       end
end.

greet.pas

unit greet;

interface
procedure Salute( name: string );

implementation
procedure Salute;
  begin
  WriteLn( 'Hello ', name, '!' )
  end;

end.

Hope this helps. :)

[edit]
Example use: D:\prog\delphi\hello> [b]hello[/b] What is your name? [b]Johnny Five[/b] Hello Johnny Five! D:\prog\delphi\hello> [b]hello Jacob "Mary Ann"[/b] Hello Jacob! Hello Mary Ann!

Hi there

You need to call your function / procedure with unit.procedure -

greet.Salute( ParamStr( index ) )

Hope that helps!

Thanks a lot guys!
Your answers helped a lot!
I figured out that i forgot to declare the procedure in the unit.

This question has already been answered. Start a new discussion instead.