Date: Wed, 12 Aug 1998 16:12:33 -0400
Reply-To: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
Sender: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
From: "Buck, Peter INS" <PBUCK@ITP.EDS.COM>
Subject: Re: RE String
Content-Type: text/plain
--or,
orig = "I:\Safe\epm.tar.gz"
parse value reverse(orig) with . "." wen "\" .
new = reverse(wen)
- Peter
> -----Original Message-----
> From: jpedone_no_spam@FLASH.NET [mailto:jpedone_no_spam@FLASH.NET]
> Sent: Tuesday, August 11, 1998 11:34 PM
> To: REXXLIST@UGA.CC.UGA.EDU
> Subject: Re: RE String
>
>
> In <35D0B42F.3FB2@vpub.powernet.co.uk>, Adrian Suri
> <asuri@vpub.powernet.co.uk>
> writes:
> >Hi,
> >
> >I have a variable in a prog
> >called TarDrive which returns a string such as
> >
> >I:\Safe\epm.tar.gz
> >
> >How can I get a new variable name from this which returns the
> >epm.tar (without the gz or prior directort info)
> >
>
> You can try something like this (assume your variable is called orig):
>
> orig = 'I:\Safe\epm.tar.gz'
> start = lastPos('\',orig)
> start = start+1
> new = substr(orig,start)
> /* at this point new = epm.tar.gz */
> /* so if the last three are always .gz - strip it */
> strip(new,'B')
> end = length(new,1)-3
> new = substr(new,1,end)
> /* new should now be epm.tar without any leading or lagging spaces */
>
>
>
> J. Pedone
> jpedone@flash.net
> http://www.flash.net/~jpedone
>
> Windows Error: 005 - Multitasking attempted. System confused.
> Computer Lie #1: You'll never use all that disk space.
>
|