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

Any time you try to append a space to a variable the results may not be what 
you expect.

RBASE does a great job of auto-trimming spaces which is a good thing 99.9% of 
the time
In this case that behaviour got in your way but a minor adjustment to your 
routine gets around that.

Dennis McGrath


________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Alastair Burr
Sent: Wednesday, October 22, 2008 8: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]<mailto:[EMAIL PROTECTED]>
-----------------------------

Reply via email to