Alastair

 I think it is because the space is the last char and SSUB is stripping
it out. If you replace the SSUB with 'Light ' it works ok.

 

SET VAR v1 TEXT = ('Light,Dark')

SET VAR v2 TEXT = ('|Blue,|Red,|Green')

SET VAR vCount INTEGER = 1

SET VAR v3 = (SRPL(.v2,'|','Light ',0))

SHOW VAR v3

 

 

You could replace the space with an underline first then replace the
underline with a space.

 

SET VAR v1 TEXT = ('Light,Dark')

SET VAR v2 TEXT = ('|Blue,|Red,|Green')

SET VAR vCount INTEGER = 1

SET VAR v3 = (SRPL(.v2,'|', ((SSUB(.v1,.vCount))+'_') ,0))

SET VAR V3 = (SRPL(.V3,'_',' ',0))

SHOW VAR v3

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Alastair
Burr
Sent: Wednesday, October 22, 2008 10:16 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: A little SRPL oddity

 

Thanks, Buddy.

 

That's a good way around but still a puzzle why any character other than
a space in the quotes gets replaced.

 

Regards,

Alastair.

        ----- Original Message ----- 

        From: Walker, Buddy <mailto:[EMAIL PROTECTED]>  

        To: RBASE-L Mailing List <mailto:[email protected]>  

        Sent: Wednesday, October 22, 2008 3:03 PM

        Subject: [RBASE-L] - RE: A little SRPL oddity

         

        Alastair

         I think it might be that RBase is stripping the ending space. I
added a space before each color and that seems to work ok.

         

        CLE ALL VAR

         

        SET VAR v1 TEXT = ('Light,Dark')

        SET VAR v2 TEXT = ('| Blue,| Red,| Green')

        SET VAR vCount INTEGER = 1

        SET VAR v3 = (SRPL(.v2, '|',(SSUB(.v1, .vCount)),0)) 

        SHOW VAR v3

         

        Buddy

         

        From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
Alastair Burr
        Sent: Wednesday, October 22, 2008 9:52 AM
        To: RBASE-L Mailing List
        Subject: [RBASE-L] - A little SRPL oddity

         

        I must be missing something obvious so can any please explain
what I'm doing wrong:

         

        SET VAR v1 TEXT = 'Light,Dark'

        SET VAR v2 TEXT = '|Blue,|Red,|Green'

        SET VAR vCount INTEGER = 1

        SET VAR v3 = (SRPL(.v2, '|', ( (SSUB(.v1, .vCount)) + ' '), 0))
-- that's a single space added

        SHOW VAR v3

         

        should give me: Light Blue,Light Red,Light Green

        but actually gives me: LightBlue,LightRed,LightGreen

        ie: no spaces.

         

        If I put a hyphen, for example, in place of the space I get
hyphenated results.

         

        The obvious (to me) answer was to use a hard space (CHAR(0160))
but that causes me problems further on as a hard space is not equal to
an ordinary space (obviously).

        The solution for that is another SRPL to replace hard spaces
with ordinary ones.

         

        It just seems a long way around so am I wrong to expect var v3
to work?

         

        Thanks for any help & regards,

        Alastair

         

        ----------------------------

        Alastair Burr

        St. Albans, UK.

        [EMAIL PROTECTED]

        -----------------------------

         

        
________________________________


        
        No virus found in this incoming message.
        Checked by AVG - http://www.avg.com 
        Version: 8.0.175 / Virus Database: 270.8.2/1739 - Release Date:
22/10/2008 07:23

Reply via email to