home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u303.dms / in.adf / DeleteBackUp.AMOS / DeleteBackUp.amosSourceCode
Encoding:
AMOS Source Code  |  1990-11-07  |  3.3 KB  |  81 lines

  1. '   ************************************ 
  2. '   *       DeleteBackUp.AMOS          * 
  3. '   * A Utility to Delete .bak Files.  * 
  4. '   *  You can load as an accessory.   *   
  5. '   * by Alan F Pfeil for APD 30-10-90 * 
  6. '   ************************************ 
  7. '
  8. ' **************************************************************** 
  9. ' * Note: For Safety, only .bak files are displayed by default.  * 
  10. ' *  Other files can be shown or deleted by erasing  '*.bak'     * 
  11. ' *  from the Requestor window  and pressing the Return key.     * 
  12. ' **************************************************************** 
  13. '
  14. '   ************************************************ 
  15. '   *   Alter lines 40 to 42 to suit your setup,   * 
  16. '   * and run, Clik the Right Mouse button to show * 
  17. '   * the existing free disk space, or the Left to * 
  18. '   * select the Drive, Directory and File from    * 
  19. '   * the File Requestor. The program will then    * 
  20. '   * display your selection and ask for your      * 
  21. '   * confirmation, delete it and show the disk    * 
  22. '   * space left free, or offer the option of a    * 
  23. '   * further deletion.                            * 
  24. '   ************************************************ 
  25. Rem  
  26. Rem Reserve memory for Zone buttons. 
  27.  Reserve Zone 3
  28. CHOOSE:
  29. Rem Display a garid warning screen 
  30.  Cls 2 : Paper 1 : Pen 2 : Home : Cline 
  31.   Centre " *** DELETE Back-Up Program. *** " : Print 
  32.   Centre " **<Erase *.bak for other files>** "
  33.  Locate 1,23 : Centre " CLIK  RightMouse to Quit."
  34.  Locate 1,24 : Centre " or to show Disk space free. "
  35. Rem
  36. Rem Leave one of the following lines active and 'Rem' the other
  37. '  two, or alter the Drive or Directory name to match your own 
  38. '  most used format.   
  39. Rem Select program to be deleted . 
  40.   F$=Fsel$("DF0:*.bak","","Kill a Bak_up prog")
  41. Rem F$=Fsel$("DF1:Amos_Progs/*.bak","","Kill a Bak_up prog") 
  42. Rem F$=Fsel$("RAD:Amos_Progs/*.bak","","Kill a Bak_up prog") 
  43. Rem
  44. Rem Quit if no file selected 
  45.    If F$="" Then Edit 
  46.  Locate 1,3 : Ink 3,0 : Print " DELETE Program: ";Left$(F$,8);" "
  47.  Print " "+Mid$(F$,9)+" "
  48. Rem You may want to alter the '8' or '9' to give a better layout 
  49. ' so that a long filename comes on a seperate line.
  50.  Locate 2,7 : Print " Please Confirm ";
  51. Rem Set up Zones 
  52.  Locate 20, : Print Border$(Zone$(" 1 Yes! KILL IT ",1),1)
  53.  Locate 1,12 : Print Border$(Zone$(" 2 NO! Check it ",2),1);
  54.  Locate 30, : Print Border$(Zone$(" 3 QUIT ",3),1)
  55.   Repeat 
  56.    Rem Get zone number
  57.     MZ=Mouse Zone : MK=Mouse Key
  58.     Locate 0,0 : Print MZ;
  59.    Rem Give visual confirmation of Zone No. selected in top left  
  60.      If MK=1 and MZ>0 and MZ=<4
  61.        If MZ=3 : Edit : End If 
  62.        If MZ=2 : Goto CHOOSE : End If 
  63.        If(MZ=1) and(F$<>"") : Kill F$ : Else Direct : End If 
  64.      End If 
  65.   Until MK<>0 : Rem Wait for mouse CLIX. 
  66. Rem
  67. Rem A RightMouse Clik will show the Free Disk Space without
  68. '  deleting a file.
  69. Rem
  70. Rem Show free disk space ... NB. This is the disk in the Drive 
  71. ' called by lines 40, 41 or 42 above; not necessarily the one  
  72. ' from which you just deleted a file.    
  73.   Locate 1,19 : Print " Free DiskSpace Left";Dfree;" Bytes " : Print 
  74.   Paper 2 : Pen 0 : Print " CLIK LeftMouse to Kill Another File, "
  75.   Print " Or ";
  76.    While Mouse Key=0 : Wend 
  77. Rem A LeftMouse Clik will recall the File Requestor regardless of
  78. '  where the pointer is located. A RightMouse Clik will Quit.
  79.   If Mouse Key=1 Then Goto CHOOSE
  80.  Cls 0
  81.  Edit