Thanks a lot for all your help. I appreciate it very much.
Stefan
> On Mon, 28 Jan 2002 22:14:38 +0100, Stefan Mueller
> >I'd like to know the time elapsed between the last and the next start of
> >my program.
> >If I start my program I'd like to save the date and time in a file so
> >the next time I start the program again I can calculate the time elapsed
> >since the last program start.
> >But how can I calculate the difference?
> >If I store TIMER I can calculated the seconds elapsed since the last
> >start if you start the program within the same day but how can I
> >calculate the difference if you restart the program several days later?
> You want this NOW, or is it Now that you want ? :-)
> Untested aircode.
> Form_Load()
> dim dLast As Date
> dim fno as Integer
> fno = freefile
> open app.path & "\logfile.bin" for binary as fno
> get #fno,, dLast
> Close fno
> msgbox("It's been " & DateDiff("s", dLast, Now) & " seconds")
> End Sub
> Form_QueryUnload()
> dim dNow As Date
> fno = freefile
> dNow = Now
> open app.path & "\logfile.bin" for binary as fno
> put #fno,, dNow
> Close fno
> End Sub
> Working out minutes and hours from seconds is trivial.
> The code above should live in separate subs really, it's no good to
> clutter either of those events with code like this, but that's just
> personal pref..
> Regards, Frank