Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on Code Required(Numbering Pages)
Message
De
21/07/2013 04:30:59
 
 
À
13/07/2013 14:49:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01578381
Message ID:
01578968
Vues:
58
>I have taken contents of text file (Post Script files) in a cursor and have reprocessed it for some purpose. Now I want to Re assign page numbers to it.
>
>The numbers of occurrence of U1 in cursor denotes the total number of Pages.
>
>Here’s my code, but its not working properly. Kinldy help
>
>
>Select Count(*) From Billcompress Where Alltrim(PS)="U1" Into Array NewHeaderpagecount
>		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 record U1 in post script means show page command i.e if suppose I insert the text ‘F8 (Page 1 of 5) 500 10 w’ before(5 records Before) U1, Page 1 of 5 will be displayed at the footer of Page 1.
>
> So Programmatically, I need to insert ‘F8 (Page 1 of 5) 500 10 w’, ‘F8 (Page 2 of 5) 500 10 w’, ‘F8 (Page 3 of 5) 500 10 w’ like wise before every occurrence of U1.
>
>It is something like this
>
>
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
>‘F8 (Page 1 of 5) 500 10 w’ && Footer Inserted
>(62.72)381 561 x
> 14 477 T  M 90 O g n
> M -90 O  -14 -477 T
>G
>U1 && End of Page 1
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
>‘F8 (Page 2 of 5) 500 10 w’ && Footer Inserted
>(62.72)381 561 x
> 14 477 T  M 90 O g n
> M -90 O  -14 -477 T
>G
>U1 && End of Page 2
>
>
>However, the above has an exception, It in between two U1, there is a text '0 -72 &Prefixmul mul translate', the footer should be placed immediately before the first occurrence of this text and not before the U1. Only Just once before the first occurrence of this text between two U1.
>
>If there is subsequent occurrence of this text between two U1, no footer command is to be placed. However, between the next occurrence of U1 there is text, it will be required again.
>
>
>
>Something like this:-
>
>
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
>‘F8 (Page 1 of 5) 500 10 w’ && Footer Inserted
>(62.72)381 561 x
> 14 477 T  M 90 O g n
> M -90 O  -14 -477 T
>G
>U1 && End of Page 1
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
>‘F8 (Page 2 of 5) 500 10 w’ && Footer Inserted
>(62.72)381 561 x
> 14 477 T  M 90 O g n
> M -90 O  -14 -477 T
>G
>U1 && End of Page 2
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>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
>‘F8 (Page 3 of 5) 500 10 w’ && Footer Inserted 
>0 -72 &Prefixmul mul translate && 
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
>0 -72 &Prefixmul mul translate && No Footer Insertion required.
>F12 (Penalty For Late Payments Made)32 571 w
>(62.72)382 570 x
>F11 (Total Charges \(Rs.\))32 561 w
> (62.72)381 561 x
>U1
>
I'd keep it simple and read in line by line and write out to a new version. If you hit a U1 insert the footer. If you hit a Prefixmul ditto but ignore the next U1.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform