Article View: borland.public.cppbuilder.nativeapi
Article #12855Re: ParamStr() extraction
From: Conny H�kansson
Date: Mon, 17 Nov 2003 00:26
Date: Mon, 17 Nov 2003 00:26
42 lines
2239 bytes
2239 bytes
Ok... i could use the strng manipulation methods in AnsiString class..
fileName.SubString(iPos=fileName.LastDelimiter("\\")+1,fileName.Length()-iPo
s+1)
So thats short enough for me.
/C
"Conny H�kansson" <conny@allimac.se> wrote in message
news:3fb80d2c@newsgroups.borland.com...
> Ok, but i only want the filename, not the entire path of the application.
So
> what im looking for is how to cut out just the name without the path. I
can
> write a function for it, but i rather not invent the wheel twice, so if
> there is a function for it i would rather use that...
>
> /C
> "Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in
message
> news:3fb80881$1@newsgroups.borland.com...
> >
> > "Conny H�kansson" <conny@allimac.se> wrote in message
> > news:3fb7fde1@newsgroups.borland.com...
> >
> > > Is there a _simple_ way of extracting only the filename from
ParamStr()
> ?
> >
> > Simply provide the index of the filename, and ParamStr() will return is.
> > For example, if the filename is passed as the first parameter, then use
> > index 1:
> >
> > AnsiString filename = ParamStr(1);
> >
> > Use ParamCount() to know if any parameters were passed to begin with.
> >
> >
> > Gambit
> >
> >
>
>
Technical Details
Message-ID:
<3fb815b5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fb7fde1@newsgroups.borland.com> <3fb80881$1@newsgroups.borland.com> <3fb80d2c@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,470da9c3a4dba621 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-16 16:39:21 PST From: "Conny H�kansson" <conny@allimac.se> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fb7fde1@newsgroups.borland.com> <3fb80881$1@newsgroups.borland.com> <3fb80d2c@newsgroups.borland.com> Subject: Re: ParamStr() extraction Date: Mon, 17 Nov 2003 01:26:36 +0100 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.215.164.250 Message-ID: <3fb815b5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069028789 217.215.164.250 (16 Nov 2003 16:26:29 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail