detect next day

BlitzMax Forums/BlitzMax Programming/detect next day

ckob(Posted 2008) [#1]
I am working on a program for work and I want it to save files every day, how would I go about detecting if its a new day?


Brucey(Posted 2008) [#2]
Check if CurrentDate() <> oldCurrentDate ?


ckob(Posted 2008) [#3]
right but what am I doing to assign oldcurrentdate? running a loop or using millisecs?


Brucey(Posted 2008) [#4]
When your app first starts, oldCurrentDate is empty... so you save... otherwise we wait til something exciting happens
Local oldCurrentDate:String

Repeat

    If CurrentDate() <> oldCurrentDate Then

        oldCurrentDate = CurrentDate()

        ' Save stuff

    End If

    ' wait a minute
    Delay(60000)
Forever



ckob(Posted 2008) [#5]
thanks I will give it a try.