home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1990-11-07 | 3.3 KB | 81 lines |
- ' ************************************
- ' * DeleteBackUp.AMOS *
- ' * A Utility to Delete .bak Files. *
- ' * You can load as an accessory. *
- ' * by Alan F Pfeil for APD 30-10-90 *
- ' ************************************
- '
- ' ****************************************************************
- ' * Note: For Safety, only .bak files are displayed by default. *
- ' * Other files can be shown or deleted by erasing '*.bak' *
- ' * from the Requestor window and pressing the Return key. *
- ' ****************************************************************
- '
- ' ************************************************
- ' * Alter lines 40 to 42 to suit your setup, *
- ' * and run, Clik the Right Mouse button to show *
- ' * the existing free disk space, or the Left to *
- ' * select the Drive, Directory and File from *
- ' * the File Requestor. The program will then *
- ' * display your selection and ask for your *
- ' * confirmation, delete it and show the disk *
- ' * space left free, or offer the option of a *
- ' * further deletion. *
- ' ************************************************
- Rem
- Rem Reserve memory for Zone buttons.
- Reserve Zone 3
- CHOOSE:
- Rem Display a garid warning screen
- Cls 2 : Paper 1 : Pen 2 : Home : Cline
- Centre " *** DELETE Back-Up Program. *** " : Print
- Centre " **<Erase *.bak for other files>** "
- Locate 1,23 : Centre " CLIK RightMouse to Quit."
- Locate 1,24 : Centre " or to show Disk space free. "
- Rem
- Rem Leave one of the following lines active and 'Rem' the other
- ' two, or alter the Drive or Directory name to match your own
- ' most used format.
- Rem Select program to be deleted .
- F$=Fsel$("DF0:*.bak","","Kill a Bak_up prog")
- Rem F$=Fsel$("DF1:Amos_Progs/*.bak","","Kill a Bak_up prog")
- Rem F$=Fsel$("RAD:Amos_Progs/*.bak","","Kill a Bak_up prog")
- Rem
- Rem Quit if no file selected
- If F$="" Then Edit
- Locate 1,3 : Ink 3,0 : Print " DELETE Program: ";Left$(F$,8);" "
- Print " "+Mid$(F$,9)+" "
- Rem You may want to alter the '8' or '9' to give a better layout
- ' so that a long filename comes on a seperate line.
- Locate 2,7 : Print " Please Confirm ";
- Rem Set up Zones
- Locate 20, : Print Border$(Zone$(" 1 Yes! KILL IT ",1),1)
- Locate 1,12 : Print Border$(Zone$(" 2 NO! Check it ",2),1);
- Locate 30, : Print Border$(Zone$(" 3 QUIT ",3),1)
- Repeat
- Rem Get zone number
- MZ=Mouse Zone : MK=Mouse Key
- Locate 0,0 : Print MZ;
- Rem Give visual confirmation of Zone No. selected in top left
- If MK=1 and MZ>0 and MZ=<4
- If MZ=3 : Edit : End If
- If MZ=2 : Goto CHOOSE : End If
- If(MZ=1) and(F$<>"") : Kill F$ : Else Direct : End If
- End If
- Until MK<>0 : Rem Wait for mouse CLIX.
- Rem
- Rem A RightMouse Clik will show the Free Disk Space without
- ' deleting a file.
- Rem
- Rem Show free disk space ... NB. This is the disk in the Drive
- ' called by lines 40, 41 or 42 above; not necessarily the one
- ' from which you just deleted a file.
- Locate 1,19 : Print " Free DiskSpace Left";Dfree;" Bytes " : Print
- Paper 2 : Pen 0 : Print " CLIK LeftMouse to Kill Another File, "
- Print " Or ";
- While Mouse Key=0 : Wend
- Rem A LeftMouse Clik will recall the File Requestor regardless of
- ' where the pointer is located. A RightMouse Clik will Quit.
- If Mouse Key=1 Then Goto CHOOSE
- Cls 0
- Edit