Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on Code Required (Numbering Pages)
Message
De
13/07/2013 11:25:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Help on Code Required (Numbering Pages)
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01578376
Message ID:
01578376
Vues:
79
I have altered a text file using VFP Table and now i need to re assign page numbers to it.

I tried the following code but it didn't worked correctly, any one please help and give the correct code

Here's Mine
Select Count(*) From Billcompress Where Alltrim(PS)="U1" Into Array NewHeaderpagecount && Counts the Number of Pages
		Goto 4
		cBillcompressedpage="%%Pages: "+Alltrim(Str(NewHeaderpagecount))
		Replace PS With cBillcompressedpage
		lcStr = Strtran(lcStr, "&Oldheaderpagecount", "&cBillcompressedpage")
		
		Locate For Alltrim(PS)="U1"
		Skip-5
		Insert Blank
		Pagenumber='F8 (Page No. 1 of '+Alltrim(Str(NewHeaderpagecount))+')500 10 w'
		Replace PS With Pagenumber

		For I=2 To NewHeaderpagecount
			NeXTTEXT='%%Page: '+Alltrim(Str(I+1))+" "+Alltrim(Str(I+1))
			Locate For PS=NeXTTEXT
			Replace PS With 'F8 (Page No. '+Alltrim(Str(I))+' of '+Alltrim(Str(NewHeaderpagecount))+')500 10 w'
		ENDFOR
The detail are as follows:-

U1:- U1 is the Show command. If there are 5 counts of U1, there should be 5 Pages in total.

I need to insert a record "Page No. 1 of 5"," Page No 2 of 5" and like wise before/prior every occurance of U1 in my cursor/DBF.

HOWEVER,

Between two U1 records, there may be a record or records like '0 -72 6.03 mul translate', if it is so, I need to insert 'Page No.X of Y' just prior to '0 -72 6.03 mul translate and that too in the first instance of occurance '0 -72 6.03 mul translate' and not in all '0 -72 6.03 mul translate' between the two U1.

Mean to say that

If the records are like this:-
F11 (Total Charges \(Rs.\))32 561 w
(62.72)381 561 x
 14 477 T  M 90 O g n
 M -90 O  -14 -477 T
G
U1
g n
F1 B (Account Number    1021337392)27 789 w
G
g n
F1 B (Invoice Number    10213373920005)566 789 x
U1
G
E 16 606 75 -12 i
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
0 -72 6.03 mul translate
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
0 -72 6.03 mul translate
F14 (STD)18 597 w
E 90 606 43 -12 i
U1
I need the inserted records as:-
F11 (Total Charges \(Rs.\))32 561 w
(62.72)381 561 x
F8 (Page No 1 of  5)+')500 10 w' && New record inserted prior to 5 records before U1
 14 477 T  M 90 O g n
 M -90 O  -14 -477 T
G
U1
F11 (Total Charges \(Rs.\))32 561 w
(62.72)381 561 x
F8 (Page No 2 of  5)+')500 10 w' && New record inserted prior to 5 records before U1
g n
F1 B (Account Number    1021337392)27 789 w
G
g n
F1 B (Invoice Number    10213373920005)566 789 x
U1
G
E 16 606 75 -12 i
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
F8 (Page No 3 of  5)+')500 10 w' && New record inserted prior 0 -72 6.03 mul translate
0 -72 6.03 mul translate
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
0 -72 6.03 mul translate && No Records inserted since the already inserted in the first instance between two U1
F14 (STD)18 597 w
E 90 606 43 -12 i
U1
G
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F8 (Page No 4 of  5)+')500 10 w' && New record inserted prior to 5 records before U1 
E 16 606 75 -12 i
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
U1
G
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F8 (Page No 4 of  5)+')500 10 w' && New record inserted prior to 5 records before U1 
E 16 606 75 -12 i
B 90 594 16 594 L
/F14{/I 6.3 Fn2}b
F14 (STD)18 597 w
E 90 606 43 -12 i
U1
Harsh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform