| View previous topic :: View next topic |
| Author |
Message |
Pat Guest
|
Posted: Thu May 10, 2007 9:29 pm Post subject: Filename problem |
|
|
Hi,
Is there any way to extract the filename from an OpenDialog? I would like
to be able to put only the filename and extension into an Edit box. When I
try to use:
Edit1->Text = OpenDialog->FileName;
I get the pathh and all listed in the Edit box. I know that this should be
easily done it's just that I can't ssem to find an answer to my searches.
Thank you for your kind help.
Pat |
|
| Back to top |
|
 |
Robert G. Hoover Guest
|
Posted: Thu May 10, 2007 9:44 pm Post subject: Re: Filename problem |
|
|
Is this what you're asking for or did I misunderstand your question...?
Edit1->Text = ExtractFileName(OpenDialog->FileName);
Rob
Pat wrote:
| Quote: | Hi,
Is there any way to extract the filename from an OpenDialog? I would like
to be able to put only the filename and extension into an Edit box. When I
try to use:
Edit1->Text = OpenDialog->FileName;
I get the pathh and all listed in the Edit box. I know that this should be
easily done it's just that I can't ssem to find an answer to my searches.
Thank you for your kind help.
Pat
|
|
|
| Back to top |
|
 |
Pat Guest
|
Posted: Thu May 10, 2007 10:13 pm Post subject: Re: Filename problem |
|
|
Thanks Rob,
That is exactly what I was looking for! Just as a side note I looked
high and low for this answer, all of my reference books and on line help
and so on. 10 seconds with someone who know something......
Thank you ever so much
Pat
Robert G. Hoover wrote:
| Quote: | Is this what you're asking for or did I misunderstand your question...?
Edit1->Text = ExtractFileName(OpenDialog->FileName);
Rob
Pat wrote:
Hi,
Is there any way to extract the filename from an OpenDialog? I would like
to be able to put only the filename and extension into an Edit box. When I
try to use:
Edit1->Text = OpenDialog->FileName;
I get the pathh and all listed in the Edit box. I know that this should be
easily done it's just that I can't ssem to find an answer to my searches.
Thank you for your kind help.
Pat
|
|
|
| Back to top |
|
 |
Robert G. Hoover Guest
|
Posted: Thu May 10, 2007 10:38 pm Post subject: Re: Filename problem |
|
|
Hi Pat,
I have the same problem. You gotta know (or guess) where to look.
Look up "SysUtils" in the BCB help files. There are a LOT of goodies in there...
ExtractFilePath
ChangeFileExt
ExtractRelativePath
ExcludeTrailingPathDelimiter
....just to name a few. These little gems save me a LOT of time!
Rob
Pat wrote:
| Quote: | Thanks Rob,
That is exactly what I was looking for! Just as a side note I looked
high and low for this answer, all of my reference books and on line help
and so on. 10 seconds with someone who know something......
Thank you ever so much
Pat
Robert G. Hoover wrote:
Is this what you're asking for or did I misunderstand your question...?
Edit1->Text = ExtractFileName(OpenDialog->FileName);
Rob
Pat wrote:
Hi,
Is there any way to extract the filename from an OpenDialog? I would
like to be able to put only the filename and extension into an Edit
box. When I try to use:
Edit1->Text = OpenDialog->FileName;
I get the pathh and all listed in the Edit box. I know that this
should be easily done it's just that I can't ssem to find an answer
to my searches.
Thank you for your kind help.
Pat
|
|
|
| Back to top |
|
 |
Pat Guest
|
Posted: Fri May 11, 2007 10:56 pm Post subject: Re: Filename problem |
|
|
Hey thanks Rob,
That really helps!
Pat
Robert G. Hoover wrote:
| Quote: | Hi Pat,
I have the same problem. You gotta know (or guess) where to look.
Look up "SysUtils" in the BCB help files. There are a LOT of goodies in there...
ExtractFilePath
ChangeFileExt
ExtractRelativePath
ExcludeTrailingPathDelimiter
...just to name a few. These little gems save me a LOT of time!
Rob
Pat wrote:
Thanks Rob,
That is exactly what I was looking for! Just as a side note I looked
high and low for this answer, all of my reference books and on line help
and so on. 10 seconds with someone who know something......
Thank you ever so much
Pat
Robert G. Hoover wrote:
Is this what you're asking for or did I misunderstand your question...?
Edit1->Text = ExtractFileName(OpenDialog->FileName);
Rob
Pat wrote:
Hi,
Is there any way to extract the filename from an OpenDialog? I would
like to be able to put only the filename and extension into an Edit
box. When I try to use:
Edit1->Text = OpenDialog->FileName;
I get the pathh and all listed in the Edit box. I know that this
should be easily done it's just that I can't ssem to find an answer
to my searches.
Thank you for your kind help.
Pat
|
|
|
| Back to top |
|
 |
|