Arnold Magno
2nd June 2005, 07:49
Hi,

Is there a function available in baan5c that has a find and replace like functionality? For example i want to convert "$10000.00" to just 10000.00 because i will replace " and $ sign with a "" an empty string.

Thanks for your help,
Arnold

richard
2nd June 2005, 17:52
There is maybe an sql possibility like:

You can use SQL

Update ttttxt010xxx
set t$text = translate( ...
where instr(a.t$text, ...) > 0

Regards

Hitesh Shah
2nd June 2005, 18:58
Similar to instr function u may use baan functions pos / rpos to accomplish the objective u desire.

mark_h
2nd June 2005, 19:02
Are you talking searching and replacing item text or just a string variable?

For text what we do is write it to a file(text.read), then use sed to search and replace. Then we put the text back using text.rewrite.

For just a string variable I use pos() to locate what I just do a replace. Or for a string you can use string.scan to separate a variable - then just add them back together with the replacement string.

Arnold Magno
3rd June 2005, 08:20
Thanks everyone i think i'll try to use pos()..

Regards,
Arnold

Evert-Jan Bosch
3rd June 2005, 11:47
Yesterday I tried to post, but did not succeed.
May be it is not needed anymore.
But I did already the work :-).

You can use function string.scan.string dollarsign(1)
double amount
long ret

ret = string.scan("$1000.00","%s%f",dollarsign,amount,)
| dollarsign contains "$"
| amount contains 1000.00

Chaitanya
2nd February 2009, 13:04
Hi,

Function in ERP LN for find and replace is

Before using this function add library "ttdllstring"

Example:

whinr940.item = 85.04.90.10
search.and.replace(whinr940.item,".","")
Now the value in whinr940.item = 85049010

I have already used this function and hope it works for you