@ReplaceSubstring

I’m trying to construct a cluster server name from an existing server name. The way client’s naming works …

cluster for Notes008 = Notes108 and vice versa

@ReplaceSubstring(OldServer; “Notes0” : “Notes1”; “Notes1” : “Notes0”)

replaces Notes108 with Notes008 but not the reverse. If the OldServer is Notes008 it does not do anything. It might be obvious why, I’m just not seeing it.

Thanks

Subject: @ReplaceSubstring

I’m not sure exactly the order in which this function processes, but it sounds like anything with Notes008 is getting processed twice. First it gets changed to Notes108, then it gets changed back to Notes008. That would be my guess.

Subject: @ReplaceSubstring

I’m thinking it may be flipping it to 108 and then back to 008.

i.e. Change 0 to 1, change 1 to 0

Does this work instead ?

@ReplaceSubstring(OldServer; “Notes0” : “Notes1” : “Notes_”; “Notes_” : “Notes0” : “Notes1” )

i.e. Change 0 to _, change 1 to 0, change _ to 1

Subject: RE: @ReplaceSubstring

That makes sense, will try. Thanks

Subject: RE: @ReplaceSubstring

t := @ReplaceSubstring(“abc”; “b”:“c”:“d”:“e”:“f”; “c”:“d”:“e”:“f”:“g”);@StatusBar("t = " + t)

output: t = agg

Does that clue you in to the problem?

Subject: RE: @ReplaceSubstring

It does. Thanks