home *** CD-ROM | disk | FTP | other *** search
- {->>>>GetExt<<<<-----------------------------------------------}
- { }
- { Filename : GETEXT.SRC -- Last Modified 9/29/88 }
- { }
- { Given a legal DOS file name with an extention, this routine }
- { returns the extension. If the file has no extension, it }
- { returns an empty string. }
- { }
- { From: COMPLETE TURBO PASCAL 5.0 by Jeff Duntemann }
- { Scott, Foresman & Co., Inc. 1988 ISBN 0-673-38355-5 }
- {--------------------------------------------------------------}
-
- FUNCTION GetExt(FileName : String80) : String80;
-
- VAR
- DotPos : Integer;
-
- BEGIN
- DotPos := Pos('.',FileName);
- IF DotPos = 0 THEN GetExt := '' ELSE
- GetExt := Copy(FileName,DotPos,(Length(FileName)-DotPos)+1);
- END;