' FileDanger.ibas

{CREATORID "LDFI"}
{VERSION "1.0"}
{RESOURCEFILE "FileApplet.rsrc"}

BEGIN
 GOSUB _WhatToDo
 REPEAT
  INPUT K$
  SELECT CASE K$
   CASE "1"
    T$="2,MemoDB,MemoDB~copy"
    GOSUB _DoIt
   CASE "2"
    T$="1,MemoDB~copy"
    GOSUB _DoIt
   CASE "3"
    T$="2,iziBasic,iziBasic~copy"
    GOSUB _DoIt
   CASE "4"
    T$="1,iziBasic~copy"
    GOSUB _DoIt   
  END SELECT 
 UNTIL K$="5"
END

_WhatToDo:
 PRINT "What to do?"
 PRINT "1. Copy MemoDB to MemoDB~copy"
 PRINT "2. Delete MemoDB~copy"
 PRINT "3. Copy iziBasic to iziBasic~copy"
 PRINT "4. Delete iziBasic~copy"
 PRINT "5. Exit"
RETURN

_DoIt:
 P$=CALLPP$(100,T$)
 CLS
 GOSUB _WhatToDo
 PRINT
 PRINT ">> ";
 PRINT K$;
 PRINT " -> ";
 IF P$="1" THEN
  PRINT "I did it!"
 ELSE
  PRINT "Something went wrong..." 
 ENDIF
RETURN
