Lotus Script equiviant of @ReplaceSubstring

Hi everybody,

I have some code that replaces the / of a date with -.

So it would be replacing 10/10/2006 with 10-10-2006.

I have code for this in formula language, can anyone help me to accomplish the same thing with LS. I have looked at a mid statement but it doesn’t seem to work the same way.

Here is the code.

x := @Text(projectDate);

y := @ReplaceSubstring(x; “/”; “-”);

Thanks in advance.

Subject: Lotus Script equiviant of @ReplaceSubstring

Take a look at the Replace function.

http://www.codestore.net/help/help6_designer.nsf/f4b82fbb75e942a6852566ac0037f284/a5d6f142b9a75b7d85256c1c003fcad1?OpenDocument

Subject: RE: Lotus Script equiviant of @ReplaceSubstring

Take a look at that,

Then take a look at this…

https://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/4822699dc043d181852572200017229e?OpenDocument

Then write your own =)

Simon

Subject: RE: Lotus Script equiviant of @ReplaceSubstring

That’s definitely not the case when I try it in my 7.01 client. That is to say, the Replace function works as I would expect when I try it using the string you provided in the thread referenced.

This code in a button:

Sub Click()

Const NL = {

}

Dim strTestVal As String

Dim strRez As String



strTestVal$ = "%2Fsomeurl%2Fpath%2F"

strRez$ = Replace(strTestVal$, {%2F}, {/})



Msgbox "Original value: " & strTestVal$ & NL & "Resulting value: " & strRez$, , "DEBUG . . ."

End Sub

yields these results:


DEBUG . . .


Original value: %2Fsomeurl%2Fpath%2F

Resulting value: /someurl/path/


OK


Subject: RE: Lotus Script equiviant of @ReplaceSubstring

Wooooh

One of the last Notes users in this forum !

:wink: :wink: :wink: :wink:

ian

Subject: *There are still quite a few of us (although I can’t imagine why there are not more, honestly)

Subject: RE: Lotus Script equiviant of @ReplaceSubstring

Also works fine for me. I get the same results as Dallas

Original value: %2Fsomeurl%2Fpath%2F

Resulting value: /someurl/path/

and I’m using the 6.5.1 client

Subject: RE: Lotus Script equiviant of @ReplaceSubstring

I thought I was goin mad till someone responded with same issue. Mebbe 7.0.2 only is bugged.

Simon

Subject: Lotus Script equiviant of @ReplaceSubstring

Hi

I wrote a single function for some DBs we use.

e.g. use:

tmp$=replaceStr$(tmp$,"&","&")

=> tmp$=“éà”

will give : “éà”

with :

Function replaceStr$(tmp$,o$,r$)

Dim tmpp$(0)

Dim oo$(0)

Dim rr$(0)

Dim ret

oo$(0)=o$

rr$(0)=r$

tmpp$(0)=tmp$

ret=Replace(tmpp$,oo$,rr$)

replaceStr$=Cstr(ret(0))

End Function

(this will replace EVERY instance of the searched string)

Please note that it is (c) 2006 IBM LOL!!!

ian