|
initself
|
 |
« on: March 24, 2010, 12:26:06 PM » |
|
What is the equivalent to TRIM(FOO,"|") in Paragraph language?  mb
|
|
|
|
« Last Edit: March 24, 2010, 12:28:17 PM by initself »
|
Logged
|
|
|
|
precisonline
President/Chief Technologist
Administrator
Rock Star
    
Posts: 1524
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« Reply #9 on: March 24, 2010, 06:33:34 PM » |
|
Tell me about it. How sick am I? 
|
|
|
|
|
Logged
|
-Kevin Accidents "happen"; success, however, is planned and executed.
|
|
|
|