next up previous contents index
Next: CFMakeRaw Up: Functions and procedures Previous: AssignStream

BaseName

   

Declaration:

Function BaseName (Const Path;Suf : Pathstr) : Pathstr;

Description:

Returns the filename part of Path, stripping off Suf if it exists.

The filename part is the whole name if Path contains no slash, or the part of Path after the last slash.

The last character of the result is not a slash, unless the directory is the root directory.

Errors:

None.

See also:

DirName, FExpand, Basename (1)

Example
Program Example48;

{ Program to demonstrate the BaseName function. }

Uses linux;

Var S : String;

begin
  S:=FExpand(Paramstr(0));
  Writeln ('This program is called : ',Basename(S,''));
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998