Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enhancing Performance
Message
De
23/06/2014 08:44:00
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
20/06/2014 10:16:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01602118
Message ID:
01602221
Vues:
134
You also missed the ENDCASE. Does this work for you?
LOCAL lnRecord, lnCount
Insertone=0
Inserttwo=0
lmultipage=.F.

SET STEP ON
CREATE CURSOR newbills (newpath c(20))
INSERT INTO newbills (newpath) VALUES ('test.txt')

SCAN
	Newpath=Newpath
	CREATE CURSOR BillFile (POS C(254),nSequence n(10,4))
	APPEND FROM (m.Newpath) SDF
	REPLACE ALL nSequence WITH RECNO()
	INDEX ON nSequence TAG xSeq DESCENDING

	lnCount = 0

	*already at bottom by replace
	*already in descending order by index
	SCAN && DO WHILE NOT BOF()
		lnCount	= m.lnCount + 1

		lcPOS8 = LEFT(POS,8)
		lcPOS16 = LEFT(POS,16)
		DO CASE
		CASE m.lcPOS8 ='(Page 3)'
			lmultipage=.T.

		CASE m.lcPOS8 ='(Page 2)'
			Insertone=0
			Inserttwo=1

			IF m.lmultipage=.T.
				cTexttwo='<</Duplex true /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice'
			ELSE
				cTexttwo='<</Duplex false /PageSize [595 842]/Tumble false /ManualFeed false /MediaPosition 2>> setpagedevice'
			ENDIF
			lmultipage=.F.

		CASE m.lcPOS8 ='(Page 1)'
			cTextone='<</Duplex false/PageSize  [595 842] /Tumble false /ManualFeed false /MediaPosition 0>>  setpagedevice'
			Insertone=1
			Inserttwo=0

		CASE m.lcPOS16 ='%%BeginPageSetup'
			IF m.Insertone=1
				*INSERT BLANK
				*REPLACE POS WITH cTextone
				*SKIP-2
				lnRecord = RECNO()
				lnSeq1 = nSequence
				SKIP
				lnSeq2 = nSequence
				INSERT INTO BillFile (POS,nSequence) VALUES (m.cTextone,m.lnSeq1 + ((m.lnSeq2-m.lnSeq1)/2))
				GOTO m.lnRecord
				*--
				Insertone=0
				Inserttwo=0
			ENDIF
		ENDCASE

		*-- THIS IS IMPORTANT
		IF MOD(m.lnCount, 100) = 0
			WAIT WINDOW 'Remaining Records...'+ALLTRIM(STR(RECNO())) NOWAIT
		ENDIF

	ENDSCAN

	WAIT WINDOW 'Remaining Records...'+ALLTRIM(STR(RECNO())) NOWAIT
	SET TEXTMERGE ON
	SET TEXTMERGE TO (m.Newpath) NOSHOW

	SCAN
\\<< TRIM(POS) >>
\
	ENDSCAN

	SET TEXTMERGE TO
	SET TEXTMERGE OFF
	FLUSH
ENDSCAN
>Yes Sir it was a repeatation. I corrected it. Thanks a lot.
>
>>Hi Harsh
>>
>>The following seems to be identical to the part immediate above it.
>>
>>>IF POS='%%BeginPageSetup'
>>>IF Inserttwo=1
>>>INSERT Blank
>>>Replace pos WITH cTexttwo
>>>Skip-2
>>>Insertone=0
>>>Inserttwo=0
>>>ENDIF
>>>ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform