Precisely Speaking
February 08, 2012, 01:57:36 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Equivalent of TRIM in Paragraph Language?  (Read 1353 times)
initself
Professional
***
Posts: 10


« on: March 24, 2010, 12:26:06 PM »

What is the equivalent to TRIM(FOO,"|") in Paragraph language?

 Huh

mb
« Last Edit: March 24, 2010, 12:28:17 PM by initself » Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #1 on: March 24, 2010, 12:41:45 PM »

What exactly are you trying to do, trim leading and trailing vertical bars?
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
initself
Professional
***
Posts: 10


« Reply #2 on: March 24, 2010, 12:59:29 PM »

Trim the first pipe from my string, since I concatenated my strings like this:

L.FOO = L.FOO : "|" : BAR

So my string will look like this:

"|x|y|z"

I want to remove the leading pipe.


Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #3 on: March 24, 2010, 01:02:34 PM »

Will there only be one?  If that's the case, why not use [2,999999] (substring extraction)?
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
initself
Professional
***
Posts: 10


« Reply #4 on: March 24, 2010, 01:03:52 PM »

Felt like 9999999 was ugly.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #5 on: March 24, 2010, 01:07:26 PM »

It is.  But it's less ugly than the alternatives.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
CKilgore
Professional
***
Posts: 20



« Reply #6 on: March 24, 2010, 05:06:55 PM »

Why not use [2,LEN(FOO)-1]?  That way you don't have to worry about an upper limit to the size.
Logged

Chris Kilgore
Brake Supply Co., Inc.
Prelude ADS Version 20.2
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #7 on: March 24, 2010, 05:17:38 PM »

Good question.  The difference is speed between a hard limit and a LEN() call is palpable.  Maybe for one call, no big deal, but if in a loop or used to process a whole bunch of records, 999999 will be recognizably faster than LEN().

The Reality platform used to (and might still) have the ability to do this:

variable[2,-1]

I always thought that was a Very Cool Thing because it makes it obvious that you want the end of the string.  The 99999 trick isn't really 100% obvious, and it inevitably ends up creating a bug, like the 999 character limit on the @PARAM variable in SB+.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
initself
Professional
***
Posts: 10


« Reply #8 on: March 24, 2010, 06:18:58 PM »

The 99999 trick isn't really 100% obvious, and it inevitably ends up creating a bug, like the 999 character limit on the @PARAM variable in SB+.

What a horrible thing to have to commit to memory.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #9 on: March 24, 2010, 06:33:34 PM »

Tell me about it.  How sick am I? Smiley
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!