And you're doing it again. Why do you insist on starting multiple threads for the same problem on the same day? It's annoying and will cause people to just start skipping over your name.
You need to check out the 'Continue' statement of the Locate.
>I have a DBF file Which has around 500 Records. I am trying to Find the Second and Subsequent occurrence of Word "U1" in the the records and insert One Record prior to 'U1' with some of my required Text.
>
>I am using the following code for this.
>
>
> GO TOP
> FOR I=1 TO NewHeaderpagecount
> LOCATE FOR ALLTRIM(PS)="U1" AND RECNO()>U1Recno
> U1Recno=RECNO()
> SKIP-1
> INSERT Blank
> Replace PS WITH "F12 B (Page No. &I)498 21 w"
> ENDFOR
>
>
>The above code is inserting my required Text Just prior to First occurrence of "U1" only. While my requirement is that It Should Replace my required text from 2nd ocurrence of "U1" and subsequent U1 and First Occurrence should not be Disturbed.
>
>Also The in Text "F12 B (Page No. &I)498 21 w", the value of I is not coming as 1,2 ,3 ,it is coming as &I.
>
>Kindly resolve the Problem
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place