Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lpstr problems
#6
here's the code, show me how to avoid tmp1 and tmp2 usage if possible to do so

Macro Macro13
Code:
Copy      Help
lpstr s="ceci est mon test olympia venus"  <<<<both venus and olympia should be replaced by the uppercased first letter version
RemplaceMots(&s)
out s
;ceci est mon test Olympia Venus  <<<<<< wanted result

Main routine

Function RemplaceMots
Code:
Copy      Help
function $&texte

str s.getmacro("GarderCasse")   <<<< in this is replacement words mapping (venus,Venus)

ARRAY(lpstr) tmpArray
lpstr g
IStringMap m._create
m.Flags=1|2
m.AddList(s "csv")

str tmp1=texte
str tmp2=texte

tok tmp1 tmpArray -1 "" 1

for _i 0 tmpArray.len
,g=m.Get(tmpArray[_i])
,if(g)
,,tmp2.findreplace(tmpArray[_i] g)
texte=tmp2


Messages In This Thread

Forum Jump:


Users browsing this thread: 8 Guest(s)