[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Carl's USAVE delete routine



Reply to note from Harry Binswanger  Fri, 25 Mar
2005 16:10:27 -0500

Harry:

Of course, adapt any U2 routine as you see fit. But do establish
your adaptations as separate frames, with new framenames, and keep
the original frames in U2, unchanged (as you did). Two reasons for
this: 1) You may, occasionally, make errors. 2) Our XyWWWeb frames
are designed to interact with each other; a change in even a single
frame can affect U2 in unexpected ways.

As to the routine to delete dated backup files -- please try the
revised code below (and ditch the earlier one). This one is a
"live" routine, not a demo, but it will only delete a file after
confirmation -- and it allows you to browse each file before
deciding whether or not to delete it (does this by calling frame DTF
-- DeleteThisFile). The internal procedures differ in some respects
from the first version, so allow me to defer answering your
questions about coding until you've given this one a try.

Two quick things, though: The "YY" arg that is handed to SDIR
expands the scope of the DIR listing back to the beginning of the
current year. This gives you the opportunity to delete older files,
as well as more recent ones, up to the cutoff date. Change it to
"YYMM" if you like; then the routine will only look back to the
beginning of the current month. I adjusted the cutoff date as
requested; it's now the current date minus two (2) days.

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX21,{<}VA$WA{>}{>}{<}IF{<}PV21{>}<1{>}{<}PRNo window{>}{<
}EX{>}{<}EI{>}{<}SX22,{<}VA$SD{>}{>}{<}IF({<}IS22{>}+"{014}")
{240}",{014}"{>}{<}SX22,{<}IS22{>}+",H"{>}{<}EI{>}[BX_]dsort{032}
d[Q2_];*;[cr|lf]{<}SX50,{<}VA$DAyy{>}{>}[BX_]exist {<}PV50{>}
*.*[Q2_]{<}IF{<}ER{>}{>}{<}PRNo matching files{>}{<}EX{>}{<}E
I{>};*;[cr|lf][BX_]func #{<}PV21{>}[Q2_][JM_]2.sdir[Q2_][BX_]
dsort {<}PV22{>}[Q2_][DO_][FF_];*;[cr|lf]{<}SX21,{<}VA$DAm/d/
yyy{>}{>}[JM_]2.jdn[Q2_]{<}SX50,{<}PV50{>}-2{>}[JM_]2.jdn2dat
e/nv[Q2_];*;[cr|lf]{<}SX21,{<}VA@50/1{>}{>}{<}IF{<}VA|21{>}<2
{>}{<}SX21,"0"+{<}IS21{>}{>}{<}EI{>}{<}SX22,{<}VA@50/2{>}{>}{
<}IF{<}VA|22{>}<2{>}{<}SX22,"0"+{<}IS22{>}{>}{<}EI{>}{<}SX23,
{<}VA@50/3{>}{>}{<}SV24,{027}X{027}X{>}{<}XS23,24,24,,24{>}{<
}SX21,{<}IS24{>}+{<}IS21{>}+{<}IS22{>}{>}{<}SV22,{027}X{027}X
{027}X{027}X{027}X{027}X{>}[DO_][FF_];*;[cr|lf]{<}LBa{>}{<}SX
50,{<}VA$DR{>}{>}{<}IF"___.__"{238}{<}IS50{>}<0{>}[JM_]2.GetP
ath[Q2_]{<}XS51,22,,23,24{>}{<}IF{<}IS23{>}<{<}IS21{>}{>}{<}S
V50,{>}[JM_]2.dtf[Q2_][DO_][FF_]{<}IF{<}va$kc{>}<2{>}{<}PRQui
t{>}{<}EX{>}{<}EI{>}{<}IF{<}va$kc{>}<>21{>}[LD_]{<}EI{>}{<}GL
a{>}{<}EI{>}{<}EI{>}{<}PRDone{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx