.key dest,Flag/k
.bra {
.ket }
.def dest SYS
failat 21

;
; CopyCDesk.bat
;

lab StartCDesk
   type 'CopyCDesk.txt
   ask -dY " Copy City Desk 2.0? Y"
   if warn                   ; no, dont copy City Desk 2.0,
      skip END
   endif

lab InsertCDesk
   assign >nil: CityDesk_2.0: exists      ; check if they put disk in
   if warn                                ; No Disk, Ask for it
      echo "*N Please insert CityDesk_2.0 Disk and press Return to continue"
      ask  -dy " or type N and Return to cancel copying of City Desk 2.0 "

         ; if typed "n" then don't copy City Desk 2.0, go to END
         ;
         ; if typed "y" or return then check for disk
         ; if disk not found then ask again
         ; if disk is found then skip to CopyCDesk

      if  warn                            ; no, don't copy City Desk 2.0
         skip END
      endif                               ; Yes, do copy City Desk 2.0
         skip InsertCDesk BACK            ; go back and check for disk again
   endif                                  ; CityDesk_2.0 Disk is available


lab CopyCDesk
if {dest} eq "SYS"
   echo "*Ec*N Where shall I put City Desk 2.0?"
   echo "*N -->1) SYS:CityDesk"
   echo "*N    2) SYS:"
   echo "*N    3) I was only joking, I really don't want to copy City Desk 2.0"
   echo "*N Please choose an option by typing its number. Then press Return ?" NOLINE
   setenv >NIL: Choice{$$} ?
      if $Choice{$$} EQ 1 VAL
         Skip 3
      endif

      if $Choice{$$} EQ 2 VAL
         Skip 4
      endif

      if $Choice{$$} EQ 3 VAL
         Skip 5
      endif
         skip FUBAR
else
   echo "*Ec*N Where shall I put City Desk 2.0?"
   echo "*N -->1) {dest}:CityDesk"
   echo "*N    2) {dest}:"
   echo "*N    3) SYS:CityDesk"
   echo "*N    4) SYS:"
   echo "*N    5) I was only joking, I really don't want to copy City Desk 2.0"
   echo "*N Please choose an option by typing its number. Then press Return ?" NOLINE
   setenv >NIL: Choice{$$} ?

lab eval_Choice{$$}
   if $Choice{$$} EQ 1 VAL                ; Copy City Desk 2.0 to {dest}:CityDesk
      if not exists {dest}:CityDesk
         makedir {dest}:CityDesk
         copy cdbat:drawer.icon to {dest}:CityDesk.info CLONE QUIET
         echo "*NDirectory {dest}:CityDesk created" NOLINE
      endif
      assign Whereto: {dest}:CityDesk
      echo "*NCopying City Desk 2.0 to {dest}:CityDesk..." NOLINE
      skip Copy_Files
   endif

   if $Choice{$$} EQ 2 VAL                ; Copy City Desk 2.0 to {dest}:
      assign Whereto: {dest}:
      echo "*NCopying City Desk 2.0 to {dest}:..." NOLINE
      skip Copy_Files
   endif

   if $Choice{$$} EQ 3 VAL                ; Copy City Desk 2.0 to SYS:CityDesk
   lab 3
      if not exists SYS:CityDesk
         makedir SYS:CityDesk
         copy cdbat:drawer.icon to SYS:CityDesk.info CLONE QUIET
         echo "*NDirectory SYS:CityDesk created" NOLINE
      endif
      assign Whereto: SYS:CityDesk
      echo "*NCopying City Desk 2.0 SYS:CityDesk..." NOLINE
      skip Copy_Files
   endif

   if $Choice{$$} EQ 4 VAL                ; Copy City Desk 2.0 to SYS:
   lab 4
      assign Whereto: SYS:
      echo "*NCopying City Desk 2.0 to SYS:..." NOLINE
      skip Copy_Files
   endif


   if $Choice{$$} EQ 5 VAL                ; abort copy
   lab 5
      Echo "*NOk, I won't copy City Desk 2.0"
      Skip END
   endif

   ; They typed in something other than the 1-3 or 1-5
   lab FUBAR
      if {dest} EQ "SYS"
         echo "*N You must type in a number between 1 and 3"
      else
         echo "*N You must type in a number between 1 and 5"
      endif
         wait 1
         skip CopyCDesk BACK

lab Copy_Files
;skip debug
   copy CityDesk_2.0:(City#?|Hyp#?)  to Whereto: CLONE QUIET
   copy CDBAT:CD.icon                to Whereto:CityDesk_2.0.info CLONE QUIET
lab Debug
   echo "*N*N City Desk 2.0 has been copied"

lab End
   echo "*NPlease wait for Menu..." NOLINE

