LoginLogin

IF DATE$==2017/9/9 THEN PRINT"Something" ?

Root / Programming Questions / [.]

ChaseCZCreated:
is there a way to make something happen on a specific date with command like on the title or somehow like that? because when i tried it, it printed that text regardless on the date or is it possible to make a variable that equals date? if i can't do it then all my plans are ruined

IF DATE$=="2017/09/09" THEN PRINT"Something"

Thanks, i have one more question. Can i make it so it doesn't care about the year but cares only about the day and month?

You can use DTREAD to extract the year,month,day,and day of the week.
DTREAD OUT year,month,day[,weekday]
So to detect Halloween you would do:
DTREAD OUT ,MONTH,DAY
IF MONTH==10 && DAY==31 THEN ...

This should work. thank you!