Topic Options
#44788 - 08/28/13 10:46 AM Is There a Better Way... Placement of Functions...
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Good morning friends at Objectif Lune,

I am curious if I am going down the wrong path with how I have been approaching making modifications to a form.

I currently have the strip function in place on a data selection that removes several different tidbits of text from the data.

The data selection is a line repeat and the custom data selection is populated with the following.
Quote:
=strip('- N (No Cr', (strip('(Sales Adj', (strip('- A (Retur', (strip('- B (Sp.Li',(strip('- C (Salva',(strip('- D (Short',(strip('- E (Color',@(&current.line, 43, 60))))))))))))))


This has been working great until I was presented with this now, I need to replace a chunk of text with another chunk of text. I need to go through the document and find "Dumped for Backhau" and replace it with "Miscellaneous"

I started to play around with the stringreplace function but haven't be successful in bringing it into the current string.

I rarely get to play with any scripting in PlanetPress so it's always a bear to get through.

Thanks for your help!

Top
#44798 - 08/28/13 04:44 PM Re: Is There a Better Way... Placement of Functions... [Re: Wildcard]
RobertOtis Offline
OL User

Registered: 08/26/13
Posts: 88
Loc: Montreal,Quebec
Hi Wildcard,

Just to begin I will suggest to store into a variable the result of your Strip function.
For the StringReplace you can try this:

Code:
=stringreplace(strip('- N (No Cr', (strip('(Sales Adj', (strip('- A (Retur', (strip('- B (Sp.Li',(strip('- C (Salva',(strip('- D (Short',(strip('- E (Color',@(&current.line, 43, 60)))))))))))))),'Dumped for Backhau','Miscellaneous')


Hope this helps.
Best regards,
Robert

Top
#44807 - 08/29/13 11:21 AM Re: Is There a Better Way... Placement of Functions... [Re: Wildcard]
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Thanks Robert!

This has given me the result that I need.

Top