----------------------------Thanks, Dennis.

You're right, auto-trimming is great - I just didn't expect it to happen when 
_adding_ a space <g>.

Regards,
Alastair.
  ----- Original Message ----- 
  From: Dennis McGrath 
  To: RBASE-L Mailing List 
  Sent: Wednesday, October 22, 2008 3:52 PM
  Subject: [RBASE-L] - RE: A little SRPL oddity


  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]

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

   



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



  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