'===========================================================================
' Subject: YEAR 2000 TEST                     Date: 12-20-97 (10:33)       
'  Author: Alexander Meyer                    Code: QB, QBasic, PDS        
'  Origin: Meyer.Karl@t-online.de           Packet: DATETIME.ABC
'===========================================================================
'                             ////
'                           0(o o)0
'-------------------------ooO (_) Ooo---------------------
' 2000TEST.BAS -- Written in QuickBasic 4.5
' 
' Name: Year 2000 Test
' Author: Alexander Meyer
' Date: 11-23-1997
' Description: This program checks the computer for
'              suitability for the year 2000.
'
'For questions or comments mail to: Meyer.Karl@t-online.de
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
'**** PLEASE READ FIRST: ****
'It is heard: The problem with the year 2000. A lot of clocks in computers
'will leap back to 1900 at the turn of the century. Their can be many
'problems with some programs.
'This program will test the DOS clock for suitability for the next
'century. Their are three tests. Two are for the turn of the century.
'if both get well nothing will happen, if one gets worse errors will be
'possible and if both get worse you should do something.
'Test 3 checks if the computer will get well with the leap year 2004.

OPEN "REBOOT.DAT" FOR BINARY AS #1
  IF LOF(1) = 0 THEN
    CLOSE #1: KILL "REBOOT.DAT": GOTO NoReboot
  ELSE
    CLOSE #1: GOTO Reboot
  END IF
CLOSE #1
NoReboot:
CLS
COLOR 14
PRINT "Year 2000 Test"
PRINT "by Alexander Meyer -- 1997"
PRINT : PRINT
COLOR 7
PRINT "WARNING:"
PRINT "With this program the date and the time will be changed and then they have to be"
PRINT "adjusted by hand."
PRINT "Continue (Y/N)"; Weiter$
WeiterMachen:
DO: K$ = INKEY$: LOOP WHILE K$ = ""
IF UCASE$(K$) = "Y" THEN GOTO Menu
IF UCASE$(K$) = "N" THEN END
GOTO WeiterMachen

Menu:
CLS
PRINT "MENU"
PRINT : PRINT
PRINT "1. Test 1 (Turn of the century 2000)"
PRINT "2. Test 2 WITH REBOOT (Turn of the century 2000)"
PRINT "3. Test 3 (Leap year 2004)"
PRINT "4. Set date and time"
PRINT "Q = Quit"
PRINT
INPUT "What do you want"; Menu$
IF Menu$ = "1" THEN GOTO Test1
IF Menu$ = "2" THEN GOTO Test2
IF Menu$ = "3" THEN GOTO Test3
IF Menu$ = "4" THEN GOTO DatumZeit
IF Menu$ = "Q" OR Menu$ = "q" THEN GOTO Quit

'**********************************************************************

Test1:
' ** Test 1 **
CLS
DATE$ = "12-31-1999"
TIME$ = "23:59:50"
PRINT "Date was changed to "; DATE$
PRINT "Time was changed to "; TIME$
DO
  LOCATE 4: PRINT DATE$
  LOCATE 5: PRINT TIME$
LOOP UNTIL TIME$ = "00:00:01"
IF DATE$ = "01-01-2000" THEN
  PRINT "It won't give problems."
ELSE
  PRINT "Problems are possible."
END IF
DO WHILE INKEY$ = "": LOOP
GOTO Menu

'***********************************************************************

Test2:
' ** Test 2 **
CLS
PRINT "WARNING:"
PRINT "This test will reboot your computer."
PRINT "You will lose any unsaved work."
PRINT "DON'T START THIS FROM WINDOWS"
PRINT "Continue (Y/N)"; Weiter$
WeiterMachen2:
DO: K$ = INKEY$: LOOP WHILE K$ = ""
IF UCASE$(K$) = "Y" THEN GOTO Weiter
IF UCASE$(K$) = "N" THEN END
GOTO WeiterMachen2
Weiter:
DATE$ = "12-31-1999"
TIME$ = "23:59:00"
LOCATE 10
COLOR 14
PRINT "To see the result start this program again after the reboot."
COLOR 7
LOCATE 11: PRINT "Press any key to cancel"
DO
  Seconds = VAL(MID$(TIME$, 7, 2))
  Seconds = 60 - Seconds
  LOCATE 12
  PRINT "Still"; Seconds; "seconds"
  PRINT TIME$
  IF INKEY$ <> "" THEN END
LOOP UNTIL TIME$ = "00:00:00"
OPEN "REBOOT.DAT" FOR OUTPUT AS #1
  PRINT #1, "2000TEST"
CLOSE #1
OUT &H64, &HFE          'Taken from an old ABC packet

'*********************************************************************

Test3:
' ** Test 3 **
CLS
DATE$ = "02-28-2004"
TIME$ = "23:59:50"
PRINT "Date was changed to "; DATE$
PRINT "Time was changed to "; TIME$
DO
  LOCATE 4: PRINT DATE$
  LOCATE 5: PRINT TIME$
LOOP UNTIL TIME$ = "00:00:01"
IF DATE$ = "02-29-2004" THEN
  PRINT "It won't give problems."
ELSE
  PRINT "Problems are possible."
END IF
DO WHILE INKEY$ = "": LOOP
GOTO Menu

'************************************************************************

DatumZeit:
CLS
PRINT "Current date: "; DATE$
INPUT "New date    : ", Neu$
IF Neu$ <> "" THEN DATE$ = Neu$
PRINT "New date    : "; DATE$
PRINT : PRINT
PRINT "Current time: "; TIME$
INPUT "New time    : ", Neu$
IF Neu$ <> "" THEN TIME$ = Neu$
PRINT "New time    : "; TIME$
DO: LOOP WHILE INKEY$ = ""
GOTO Menu

'*************************************************************************

Reboot:
CLS
PRINT "-- Result --"
PRINT : PRINT
PRINT "After reboot the date is "; DATE$
IF DATE$ = "01-01-1980" THEN
  PRINT "probably errors will appear."
ELSEIF MID$(DATE$, 7, 4) = "1980" THEN
  PRINT "It is possible that errors appear."
ELSE
  PRINT "There will be no errors."
END IF
DO WHILE INKEY$ = "": LOOP
KILL "REBOOT.DAT"
GOTO Menu

'**********************************************************************

Quit:
CLS
COLOR 14
PRINT "Thanks for using Year 2000 Test"
PRINT
END
REM                             -- EOF --
'***********************************************************************
