; $VER: Desert_Date V1.1 (28-Jan-1995) ©1995 Terence Nichols
; A script to assist in setting the date on Amiga's without a
; Battery backed up Clock.
; Desert_Date Requires the following AmigaDOS Commands :
; Date             C:
; Echo           * Internal
; Else           * Internal
; EndIf          * Internal
; Eval             C:
; Failat         * Internal
; If             * Internal
; InString         C:
; Lab            * Internal
; rtEZRequest      C:
; rtGetString      C:
; Resident       * Internal
; Set            * Internal
; Skip           * Internal
; SubString        C:
; Unset          * Internal
; Unsetenv       * Internal
; Which            C:
;
; This Program Script is Copyright ©1995 Terence Nichols and may be
; distributed as Shareware as per the GNU Public Licence.
; Please Send the Author an E-mail or Netmail if you use it.
; That is all I ask for as a fee.
;
; Terence Nichols
; Internet : spinnedev@amioz.apana.org.au
; FidoNet  : 3:713/817.2
;          : 3:690/662.2
; AmigaNet : 41:200/817.2
;          : 41:616/662.2
;
;
Resident C:Eval PURE
 Resident C:rtEZRequest PURE
  Resident C:rtGetString PURE
   Echo "*e[32mDesert_Date V1.1 *e[31mby *e[33mTerence Nichols *e[31m"
    Echo ""
     Failat 20
      Set title Desert_Date V1.1
       Which ENV:olddate > ENV:temp
           IF Warn
              Date TO ENV:olddate
           Endif
              Date $olddate
         rtEZrequest TITLE "$title" BODY "Currently Saved\n Date & Time is :\n$olddate\n Change it ?" BUTTON "_Yes|_No" CENTER
          Set Req $RC
              IF $Req EQ "1"
                 Instring " " "$olddate" > ENV:temp
                  Eval $temp > ENV:start
                   Substring "$olddate" 1:$start > ENV:day
                    Eval $start+9 > ENV:end
                     Substring "$olddate" $start:$end > ENV:date
                    Eval $end+2 > ENV:start
                   Eval $start+8 > ENV:end
                  Substring "$olddate" $start:$end > ENV:time
                 rtGetString TITLE "$title" BODY "    Options : Syntax\n       Full : $olddate\nDate & Time :$date $time\n  Date Only :$date\n  Time Only : $time\n " default "$olddate" HIGHLIGHT BACKFILL TO ENV:newdate
              Else
                 Skip FINNE
              EndIF
           Date $newdate TO ENV:newdate
          rtEZrequest TITLE "$title" BODY "Save the New Date & Time\n$newdate" CENTER
              IF $RC EQ "1"
                 Date $newdate
                  Date TO ENVARC:olddate
                 Date TO ENV:olddate
              EndIF

Lab FINNE
 
Unset Req
 Unset title
  Unsetenv newdate
   Unsetenv day
    Unsetenv date
     Unsetenv time
     Unsetenv temp
    Unsetenv start
   Unsetenv end
  Resident Eval REMOVE
 Resident rtEZRequest REMOVE
Resident rtGetString REMOVE
