[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

OpenDialog Returns Path with File Name

Posted on 2000-01-24
3
Medium Priority
?
163 Views
Last Modified: 2010-04-04
I need OpenDialog to return just the name of the file in the string grid , but its returning the path with it. Here is a Sample of code:

if ACOL = 1 then
    begin
    if OpenDialog2.Execute then
      OpenDialog2.InitialDir := ListGrid.Cells[0, AROW];
      ListGrid.Cells[1, AROW] := OpenDialog2.FileName ;
end;


Any Ideas...
0
Comment
Question by:routerboy309
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 200 total points
ID: 2382379
ListGrid.Cells[1, AROW] := ExtractFileName(OpenDialog2.FileName) ;



Good luck!!
0
 

Author Comment

by:routerboy309
ID: 2382396
That works. Is that because its the extraction of the path statement....
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2382462
Yeah... Delphi has a number of built in functions that handle parsing of filenames for you... ExtractFileDir, ExtractFileName,ExtractfileExt,etc...

You can find them in the Help file...

Good luck!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question