Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want code to remove printer info in reports
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477979
Message ID:
00477982
Vues:
22
I have been using this from a project hook. I have it setup to ask me if I want to run it every time I compile my .exe. You can also just run the prg.

I ALWAYS make a backup of my work before running this but I have NEVER had a problem with it. It is just good practice.

Hope this helps.
PRIVATE pnnumber, pcdirlist, pcreport, pcdefault, nCount, pnans, pcdefault, pcmemofield
PRIVATE pcdelimit, pnArray, plok

MESSAGEBOX("DON'T FORGET TO SEARCH FOR STEPS!!!", 0 + 64, "BUILD NOTICE")

pnans = MESSAGEBOX("Do you want to blank out all of the printer releated fields before building?", 4 + 64, "Clearing Frx Printer Fields")
IF pnans = 6
	DEFINE WINDOW clearfrxout FROM 2,1 TO 25,75 TITLE 'CLEARFRX' CLOSE FLOAT GROW ZOOM
	ACTIVATE WINDOW clearfrxout
	CLOSE DATA ALL
	pcmemofield = ""
	pcdelimit = CHR(13)+CHR(10)
	pcdefault = SYS(5)+SYS(2003)
	plok = .F.

	SET DEFAULT TO pcdefault + "\reports"
	pnnumber = ADIR(pcdirlist, '*.FRX')				&& Create array with the reports listed

	FOR nCount = 1 TO pnnumber  					&& Loop for number of databases
		pcreport = pcdirlist(nCount,1)
		? "Processing: " + pcreport  					&& Display database names
		USE (pcreport)
		GOTO TOP

		DIMENSION pcArray(1)
		pcString = EXPR
		PARSE(pcString, pcdelimit, @pcArray)		&& parse the string in the memo field so we can examine it.

		FOR pnArray = 1 TO ALEN(pcArray)
			DO CASE pcArray(pnArray)
				CASE LEFT(pcArray(pnArray), 7) = "DRIVER="
					plok = .F.
				CASE LEFT(pcArray(pnArray), 7) = "DEVICE="
					plok = .F.
				CASE LEFT(pcArray(pnArray), 7) = "OUTPUT="
					plok = .F.
				OTHERWISE
					plok = .T.
			ENDCASE
			IF plok
				pcmemofield = pcmemofield + pcArray(pnArray) + pcdelimit
			ENDIF
		NEXT pnArray

		REPLACE EXPR WITH pcmemofield
		REPLACE TAG WITH ""
		REPLACE TAG2 WITH ""
		USE
		pcmemofield = ""
	ENDFOR

	SET DEFAULT TO &pcdefault
	RELEASE WINDOW clearfrxout

ENDIF
CLOSE DATA ALL
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform