Re: strtran() how to
From: christophe (irs.znospamforme_at_skynet.be)
Date: 10/27/04
- Next message: christophe: "Re: strtran() how to"
- Previous message: Anders Altberg: "Re: VFP: Comment or Line Continuation Gotcha"
- In reply to: Fred Taylor: "Re: strtran() how to"
- Next in thread: Anders Altberg: "Re: strtran() how to"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 12:05:34 +0200
Thanks Fred,
While reading Andrews post,
I reallised I misunderstood the nOccurence
of StrTran() and found Stuff to be better
regards
christophe
"Fred Taylor" <ftaylor@mvps.org!REMOVE> schreef in bericht
news:O27Ndu2uEHA.3416@TK2MSFTNGP09.phx.gbl...
> Then you need to use the STUFF() command if you know the position.
>
> ? STUFF(origfield,nStart,4,"pot")
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "christophe" <irs.znospamforme@skynet.be> wrote in message
> news:OaH3Ye2uEHA.1452@TK2MSFTNGP11.phx.gbl...
> > oh,
> > I see it know,
> > I thought it was a position where it should start
> > replacing.
> > Then I am in trouble because I don't really know
> > which occurence. I only know a position.
> > This code is part of a translation of dutch text to english.
> > so for this example if I want to replace the last test
> > the first test can be replace are may be not replaced,
> > it depends on what the user selects.
> > The only thing I now is which position it is "translating" or
> > how far the translation is, regardsless of what is already translated
> > and especaily regardless of the translated contents
> > so I can't check which noccurence to translate.
> >
> > any idea on how to solve this ?
> >
> > regards
> > christophe
> >
> >
> > "Andrew Howell" <ajh@work> schreef in bericht
> > news:eQBWOS2uEHA.2860@TK2MSFTNGP11.phx.gbl...
> >> christophe wrote:
> >> > This should be easy but somehow I don't get it,
> >> > in this example only the first occurrence of test should
> >> > be replaced with pot but it isn't
> >> > If I nstart = 0 then it goes well,
> >> > but I can't do it because if I only want the last
> >> > word to be replaced it won't.
> >> >
> >> > so can somebody explain me way or how to ?
> >>
> >> nstart is the number of the occurrence of the word to change. There is
> >> another optional parameter for how many replacements you want to change
> >> so
> > I
> >> think you want something like
> >>
> >> origfield = "dit is een test en dit is ook een test"
> >> nstart = 1
> >> nrepcount = 1
> >> curword = "test"
> >> newword = "pot"
> >> ? STRTRAN(origfield,curword,newword,nstart,nrepcount)
> >>
> >> --
> >> HTH
> >> Andrew Howell
> >>
> >>
> >
> >
>
>
- Next message: christophe: "Re: strtran() how to"
- Previous message: Anders Altberg: "Re: VFP: Comment or Line Continuation Gotcha"
- In reply to: Fred Taylor: "Re: strtran() how to"
- Next in thread: Anders Altberg: "Re: strtran() how to"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|