Pascal Scripting: MinimizePathName

Prototype:

function MinimizePathName(const Filename: String; const Font: TFont; MaxLen: Integer): String;

Description:

Returns a minimized filename that will not take more than MaxLen pixels to display with the given font. The minimizing is done by replacing the middle part with '...' as needed.

Example:
MyLabel.Caption := MinimizePathName(MyPathName, MyLabel.Font, MyLabel.Width);
See also:

TFont