home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Utilities / QuickFile / ARexx / DelRecs.QuickFile < prev    next >
Text File  |  2000-04-26  |  894b  |  45 lines

  1. /*
  2. $VER: DelRecs.quickfile 1.3 (26 Apr 2000  17:00:20) by M Andre Z Eckenrode
  3.  
  4. Deletes ALL Records in the current index (with confirmation).
  5.  
  6. Requires the following external function macros:
  7.  
  8.   ProgressWin.quickfile
  9.   GetViewWin.quickfile
  10.  
  11. */
  12.  
  13. options results
  14.  
  15. setindex
  16. ndx = upper(result)
  17. numrecs
  18. recs = result
  19.  
  20. if recs = 0 then do
  21.     reqmsg '"No records to delete!"'
  22.     exit
  23. end
  24.  
  25. lf = d2c(10)
  26. reqchoice '"Delete' recs 'record(s) in index' ndx'?"'
  27. if rc = 5 then exit
  28. reqchoice '"Deleting all records in index.'lf'Are you sure?"'
  29. if rc = 5 then exit
  30.  
  31. esc = d2c(27)
  32. line = '  Deleting...Record '
  33. winspec = 'arexx/progresswin'(length(line)+(2*length(recs))+4,'DelRecs.quickfile')
  34. call open(1win,winspec,'w')
  35. call writech(1win,esc'[0 p'lf||line)
  36.  
  37. do i = 1 to recs
  38.     call writech(1win,esc'[2;'length(line)+1'f'i 'of' recs)
  39.     delrec
  40. end
  41.  
  42. call close(1win)
  43. refresh
  44. reqmsg '"All records in index deleted!"'
  45.