* RPT_PATCH2.PRG * Written by Kevin Emmrich, #019174. * Modified by Terry Harris, #011927. * This PRG opens the FRX files then removes just the * TAGs and DEVICE, OUTPUT, DRIVER lines. DEACTIVATE WINDOW "Project Manager - Your Project Name" ON ERROR SET MEMOWIDTH TO 240 lcreportdir = GETDIR() IF NOT EMPTY(lcreportdir) ** Note, the ADDBS() does not exist in VFP 5, but does exist in VFP 7. ** ADDBS() adds a backslash (if needed) to a path expression. ** The VFP 5 output of GETDIR() looks like: "C:\NTAS\FORMS\". ** So, if running VFP 5, commented ou the ADDBS() line. lcreportdir = ADDBS(lcreportdir) * Store the number of "FRX" files to be processed into MVAR "lnreports". * "lafrxfiles" is an array that has the name of each "FRX" file. lnreports = ADIR(lafrxfiles,lcreportdir+"*.frx") * Give the Operator some visual feedback. CLEAR ? "Number of Reports: ", lnreports ? " " WAIT FOR nfrxcounter = 1 TO lnreports WAIT WINDOW NOWAIT "Report Number " + TRANSFORM(nfrxcounter, "@R") * Put the PATH and the FRX name into lcreportfile = lcreportdir+lafrxfiles(nfrxcounter,1) USE (lcreportfile) IN 0 ALIAS frxreport SELECT frxreport LOCATE FOR objtype = 1 AND objcode = 53 IF FOUND() *** Overview: find mline for DEVICE, OUTPUT, DRIVER * and delete these lines. * Find out how many lines are in the entire MEMO field. memolines = MEMLINES(EXPR) * Store the MEMO line number for each of these lines into MVARS. ndeviceline = ATCLINE("DEVICE=",EXPR) noutputline = ATCLINE("OUTPUT=",EXPR) ndriverline = ATCLINE("DRIVER=",EXPR) newexpr = "" FOR i = 1 TO memolines * Store all of the MEMO lines into "newexpr" except for * DEVICE, OUTPUT, & DRIVER. IF i <> ndeviceline AND i <> noutputline AND i <> ndriverline newexpr = newexpr + MLINE(EXPR,i) + CHR(13) + + CHR(10) ENDIF ENDFOR && end of FOR i = 1 TO memolines REPLACE EXPR WITH newexpr REPLACE TAG WITH "" REPLACE tag2 WITH "" ENDIF (FOUND()) USE IN frxreport ENDFOR && end of FOR nfrxcounter = 1 TO lnreports ENDIF && end of IF NOT EMPTY(lcreportdir) WAIT CLEAR WAIT WINDOW "Finished Processing Report (FRX) files..."