home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1999 January / WPCJAN99.ISO / DXRS / Buyers01.dxr / Internal_21.ls < prev    next >
Encoding:
Text File  |  1998-11-09  |  3.4 KB  |  83 lines

  1. on searchdata entereddate
  2.   global expiredentries, cutoffdate
  3.   set cutoffdate to entereddate
  4.   set expiredentries to list()
  5.   put EMPTY into field "deletion summary"
  6.   repeat with j = 1 to the number of castMembers of castLib "review_d"
  7.     set whichentry to the name of member member j of castLib "review_d"
  8.     gettopic(whichentry)
  9.   end repeat
  10.   put "count(expiredentries)" && count(expiredentries)
  11.   repeat with l = 1 to count(expiredentries)
  12.     set thismember to getAt(expiredentries, l) & "_c"
  13.     put "clearing (closeup): " && thismember & RETURN after field "deletion summary"
  14.     clearoldrecords(thismember)
  15.   end repeat
  16.   repeat with l = 1 to count(expiredentries)
  17.     set thismember to getAt(expiredentries, l) & "_f"
  18.     put "clearing (feature): " && thismember & RETURN after field "deletion summary"
  19.     clearoldrecords(thismember)
  20.   end repeat
  21.   repeat with l = 1 to count(expiredentries)
  22.     set thismember to getAt(expiredentries, l) & " graphic text"
  23.     put "clearing (graphic): " && thismember & RETURN after field "deletion summary"
  24.     clearoldrecords(thismember)
  25.   end repeat
  26.   set softwarelists to list("graphics software list", "utility software list", "business software list", "internet related software list", "reference software list", "entertainment software list", "monitors list", "computers list", "laptops list", "pdas list", "printers list", "scanners list", "storage list", "input devices list", "digital cameras list", "sound cards list", "graphics cards list", "cd-rom drives list", "hard drives list", "cd writers list", "misc list", "modems list", "pc cards list")
  27.   repeat with l = 1 to count(expiredentries)
  28.     set thismember to getAt(expiredentries, l)
  29.     repeat with m = 1 to count(softwarelists)
  30.       repeat with n = the number of lines in field getAt(softwarelists, m) down to 1
  31.         if line n of field getAt(softwarelists, m) = thismember then
  32.           delete line n of field getAt(softwarelists, m)
  33.         end if
  34.       end repeat
  35.     end repeat
  36.   end repeat
  37.   put "starting consolidation of cast review_d"
  38.   consolidatecasts("review_d")
  39.   put "finished consolidation of cast review_d"
  40.   put "starting consolidation of cast review_c"
  41.   consolidatecasts("review_c")
  42.   put "finished consolidation of cast review_c"
  43. end
  44.  
  45. on gettopic whichentry
  46.   global cutoffdate, expiredentries
  47.   set temptext to the text of field whichentry
  48.   set fieldcount to 0
  49.   repeat with i = 1 to the number of chars in temptext
  50.     if char i of temptext = "_" then
  51.       set fieldcount to fieldcount + 1
  52.       if fieldcount = 1 then
  53.         set nameparameter to list(1, i - 1)
  54.       end if
  55.       if fieldcount = 4 then
  56.         set dateparameter to list(i + 1, 0)
  57.       end if
  58.       if fieldcount = 5 then
  59.         setAt(dateparameter, 2, i - 1)
  60.       end if
  61.     end if
  62.   end repeat
  63.   set thisentry to chars(temptext, getAt(nameparameter, 1), getAt(nameparameter, 2))
  64.   set thisdate to chars(temptext, getAt(dateparameter, 1), getAt(dateparameter, 2))
  65.   if length(thisdate) < 5 then
  66.     set thisdate to "0" & thisdate
  67.   end if
  68.   set thisdate to chars(thisdate, 4, 5) & chars(thisdate, 1, 2)
  69.   set datevalue to value(thisdate)
  70.   if datevalue < cutoffdate then
  71.     append(expiredentries, thisentry)
  72.     put thisdate && thisentry & RETURN after field "deletion summary"
  73.   end if
  74. end
  75.  
  76. on clearoldrecords thismember
  77.   global cutoffdate
  78.   set checkexists to the number of member thismember
  79.   if checkexists > 1 then
  80.     erase(member thismember)
  81.   end if
  82. end
  83.