Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening files with different extension 1

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I have set my opendialog to have 3 filters. (fcc,acv,psp).
Now depending of the kind of extension it is selected, i will be processing the files in different maners.
Is there an easy was to find out what kind of file is been opened? Or should i just parse the filename until i find the .xxx extension? The proplem is if the computer is set not to show know extensions, that may not work.

Right now, i have something like that:
openDialogCurves.InitialDir := GetCurrentDir;
openDialogCurves.Options := [ofFileMustExist];
openDialogCurves.FilterIndex := 1;
if openDialogCurves.Execute then
begin
//if extension is acv then processacv
//if extension is fcc then processfcc

Thanks.
PO
 
use the ExtractFileExt function, and possibly this faq102-6110
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top