• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Filename without extension

hi,

How do I get the Filename without the extension from the opendialog1.Filename

So I get Label.Caption := ...
Thanks
0
hellfire052497
Asked:
hellfire052497
1 Solution
 
interCommented:
Hi,
This is the code fragment

var
  L : integer;
  S: string;
begin
...
  S := OpenDialog1.FileName;
  L := Length(S);
  while (L > 0) and ( S[L] <> '.') do  Dec(L);
  if L <> 0 then SetLength(S, L-1);
  Label1.Caption := S;
..
end;
Regards
Igor  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now