* Yuri Rubinov July 2000 * Modified by Tracy C Holzer to allow for selecting entire directory * or a specific frx file * Remove printer specific setting in report form *--------------------------------------------------- PARAMETER pRepoForm CLEAR LOCAL lcdefault, llokay lcDefault=UPPER(SYS(2003)) IF TYPE("pRepoForM")#"C" LOCAL lcnewdefault lcnewdefault=GETDIR() IF !EMPTY(lcnewdefault) SET DEFAULT TO (lcnewdefault) pRepoForm="ALL" ELSE pRepoForm=GETFILE("frx") ENDIF ENDIF DO CASE CASE UPPER(pRepoForm)#"ALL" pRepoForm=LOWER(pRepoForm) IF NOT ".frx"$pRepoForm pRepoForm=pRepoForm+".frx" ENDIF IF NOT FILE(pRepoForm) pRepoForm=GETFILE("frx") IF NOT ".frx"$pRepoForm pRepoForm=pRepoForm+".frx" ENDIF IF NOT FILE(pRepoForm) =MESSAGEBOX("Report Form "+pRepoForm +" not found?!") RETURN ENDIF ENDIF DO iClean OTHERWISE *WHAT ABOUT PAGE Orientation? IF ADIR(aa,"*.frx")<=0 =MESSAGEBOX("No *.frx Report Forms found?!") RETURN ENDIF FOR ia =1 TO ALEN(aa,1) pRepoForm=aa[ia,1] DO iClean ENDFOR ENDCASE llokay=IIF(UPPER(lcdefault)=UPPER(sys(2003)),.t.,.f.) IF !llokay SET DEFAULT TO (lcdefault) ENDIF RETURN *---------------------------------- PROCEDURE iClean CLOSE TABLE ALL USE (pRepoForm) WAIT WIND TIME 0.5 "Fixing Report form "+DBF() =AFIELD(afld) * the very first record only IF ASCAN(afld,"TAG")#0 AND ASCAN(afld,"TAG2")#0 AND ASCAN(afld,"EXPR")#0 GO TOP *keep orientation and number of copies lcExpr1="" lcExpr = "COPIES=1" lcorient="ORIENTATION=0" IF "orientation"$LOWER(EXPR) lnOrientation = ATC("ORIENTATION", Expr) lcOrient="ORIENTATION" + ; SUBSTR(Expr, ; lnOrientation + 11, 02) ENDIF IF "copies"$LOWER(EXPR) lcExpr=SUBSTR(EXPR,AT("copies=",LOWER(EXPR)),8) ENDIF lcExpr1=lcOrient+CHR(13)+lcExpr+CHR(13) REPLACE TAG WITH "", tag2 WITH "", EXPR WITH lcExpr1 ? "*******************" ? EXPR ELSE =MESSAGEBOX("File "+pRepoForm+". Not VFP6 format?!") ENDIF USE RETURN>I have an unusual problem, that I am puzzled by.