'
'                MiniUtils V1.0
'                 by Ivor King 
'              
'   Read the DOCS on disk for more information 
'
'Screen Close 0
Break Off 
Global O,CLOS_WORKBENCH
Screen Open 0,640,260,16,Hires
Colour 1,3
Curs Pen 1
CLOS_WORKBENCH=False
STAT:
   MENU
   BAT:
      If O=1
         LD
         Goto STAT
      Else 
         If O=2
            CD
            Goto STAT
         Else 
            If O=3
               RF
               Goto STAT
            Else 
               If O=4
                  FM
                  Goto STAT
               Else 
                  If O=5
                     RFDS
                     Goto STAT
                  Else 
                     If O=6
                        DFFD
                        Goto STAT
                     Else 
                        If O=7
                           LDP
                           Goto STAT
                        Else 
                           If O=8 and CLOS_WORKBENCH=False
                              Close Workbench 
                              CLOS_WORKBENCH=True
                              Goto STAT
                           Else 
                              If O=9
                                 Screen Close 0
                                 End 
                              Else 
                                 Goto STAT
                              End If 
                           End If 
                        End If 
                     End If 
                  End If 
               End If 
            End If 
         End If 
      End If 
'
Procedure MENU
   Cls 
   Under On 
   Cdown 
   Pen 14
   Centre "MiniUtils V1.0"
   Pen 5
   Under Off 
   Cdown 
   Cdown 
   Centre "by Ivor King 13/7/92"
   Pen 2
   Home 
   Locate 0,7
   If CLOS_WORKBENCH=False
      Print "          1 - List directory                 5 - Show free disk space"
      Print "          2 - Create a directory             6 - Delete a file from disk"
      Print "          3 - Rename a file                  7 - List disk info to printer"
      Print "          4 - Show free memory               8 - Close workbench"
      Print "          9 - Quit"
   Else 
      Print "          1 - List directory                 5 - Show free disk space"
      Print "          2 - Create a directory             6 - Delete a file from disk"
      Print "          3 - Rename a file                  7 - List disk info to printer"
      Print "          4 - Show free memory               9 - Quit"
   End If 
   Cdown : Cdown 
   Input "Enter your option: ";O
End Proc
'
Procedure LD
   On Error Goto ABORTED
   Cls 
   Print "Note: press SPACE to halt listing or restart it again"
   Input "Enter path: ";P$
   Dir P$
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure CD
   On Error Goto ABORTED
   Cls 
   Input "Enter directory to create, and its path: ";D$
   Mkdir D$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure RF
   On Error Goto ABORTED
   Cls 
   Input "Enter name of old file: ";N1$
   Input "Enter new name for file: ";N2$
   Rename N1$ To N2$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure RFDS
   On Error Goto ABORTED
   Cls 
   SPACEFREE=Dfree
   Print "Free space on disk (in bytes):";SPACEFREE
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure DFFD
   On Error Goto ABORTED
   Cls 
   Input "Enter file to be deleted: ";DF$
   Kill DF$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure LDP
   On Error Goto ABORTED
   Cls 
   Input "Enter path you want listed: ";L$
   Input "Do you want free disk space also listed? (RETURN;yes/n;no): ";SPAC$
   Pen 4
   Print "Make sure your printer is READY, or the computer will FREEZE UP!"
   Pen 2
   Print "Use preferences to alter printer options"
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Ldir L$
   DF=Dfree
   If SPAC$=""
      Lprint "Free disk space:";DF
   Else 
      If SPAC$="y"
         Lprint "Free disk space:";DF
      Else 
         If SPAC$="yes"
            Lprint "Free disk space:";DF
         Else 
         End If 
      End If 
   End If 
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure FM
   On Error Goto ABORTED
   Cls 
   CF=Chip Free
   Print "Total chip memory presently free:";CF
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'  
End 
'
'
'(C) 1992 KING Software
