Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help on Code Required (Numbering Pages)
Message
De
13/07/2013 14:50:41
 
 
À
13/07/2013 11:57:13
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:
01578376
Message ID:
01578382
Vues:
61
I think that my original message was deleted. It was like this.

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





>No Sir, It will Not.
>
>What I am trying is to reprocess Post Script files. I have succeded in that, how ever i am finally unbale to assign page numbers to it. In a day or two I have to give my assignment and in haste I am not able to concentrate properly.
>
>The page number will be as I have shown in my original post example F8 (Page 1 of 5) 500,10 w is the command in Post Script file to Draw Page 1 of 5 with font size 8 at row column 500 and row 10.
>
>_PAGENO & _PAGETOTAL will not work for this.
>
>
>
>
>
>
>
>
>
>
>
>>>I have altered a text file using VFP Table and now i need to re assign page numbers to it.
>>
>>
>>Have you looked at:
>>
>>_PAGENO = http://msdn.microsoft.com/en-us/library/5h4k0hk8%28v=vs.80%29.aspx
>>_PAGETOTAL = http://msdn.microsoft.com/en-us/library/1617034c%28v=vs.80%29.aspx
>>
>>Will these not work for your report?
Harsh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform