Date : Tue, 21 Mar 2006 00:21:43 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Re: Web site: Mainly Master 512
Email of fidonet#2:252/27.2 wrote:
> Had the same thing happen on the A310, I wrote some Basic to restore
> the year at boot time, correcting it if a New Year had occurred since
> the date it was last booted. Worked automatically if run at least once
> a year.
This lives in my A5000's boot sequence in Boot:Choices.Boot.PreDesk
REM > CheckYear 1.00
REM Fix for RO311 clock dropping back every four years
:
SYS "OS_GetEnv" TO F$:F$=MID$(F$,1+INSTR(F$," ",1+INSTR(F$," ")))
SYS "OS_File",5,F$ TO ,,ld%,ex%
DIM time% 7,result% 7:time%!0=ex%:time%!4=ld%
SYS "OS_ConvertDateAndTime",time%,result%,8,"%CE%YR" TO A$
Y$=MID$(TIME$,12,4):IFY$=A$:END
TIME$=LEFT$(TIME$,11)+A$+MID$(TIME$,16):SYS "XOS_CLI","Stamp "+F$
IFVALA$-VALY$<>1:PRINT "Warning - clock reset from "+Y$+" to "+A$
END
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
BBC BASIC for the Sinclair Spectrum - http://mdfs.net/Software/Spectrum