Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Find The Second & Subsequent Occurrence of Record
Message
De
04/04/2013 10:02:37
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to Find The Second & Subsequent Occurrence of Record
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01570066
Message ID:
01570066
Vues:
55
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 && NewHeaderpagecount is Number of Pages For example 3 
		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" && Error is Here, It insert the after First occurrence of "U1" Only
		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
Harsh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform