anzacfalcon Posted December 23, 2009 Posted December 23, 2009 (edited) Hi, i need the code to run only in between two month/day's specified. The snippet below works perfectly but only if the Month/Day is past the specified Month/Day. $Date = @MON & "/" & @MDAY If $Date > "12/22" Then MsgBox(64, "", "Date is valid, code will run") Else MsgBox(64, "", "Date is invalid, code will not run") Exit EndIf This is what i have tried but is wrong. $Date = @MON & "/" & @MDAY If $Date > "12/22" & $Date < "12/24" Then MsgBox(64, "", "Date is valid, code will run") Else MsgBox(64, "", "Date is invalid, code will not run") Exit EndIf So how will i do this? Thanks for reading. Edited December 23, 2009 by anzacfalcon
99ojo Posted December 23, 2009 Posted December 23, 2009 Hi,quite simple:If $Date > "12/22" And $Date < "12/24" Then;-))Stefan
cramaboule Posted December 23, 2009 Posted December 23, 2009 (edited) Here is your code. You cannot "test" strings for bigger or smaller, you can do that with values !!! $Date = @MON & "/" & @MDAY If @MON = 12 then If @MDAY > 22 And @MDAY < 24 Then MsgBox(64, "", "Date is valid, code will run") Else MsgBox(64, "", "Date is invalid, code will not run") Exit EndIf EndIf Cram... EDIT: MISSTYPO Edited December 23, 2009 by cramaboule My Autoit programs: MAC Address - - Delete Temp Files - - Ping Test - - Play Video with VLC full screen dual monitors - - Set IP - - Pics Converter - - AutoUpdater - - CPU Usage - - Ending Script Nicely - - GDI+ GUI crossfades (slide transitions) - - Beamer - - Search and Search in Files - - Silent Ninite Others: Export Icons into Dll - - My website
anzacfalcon Posted December 23, 2009 Author Posted December 23, 2009 (edited) Believe it or not me and other guys method works fine. Thanks 99ojo, i was using "&" instead of "And" LoL, thanks again bro. <3 Edited December 23, 2009 by anzacfalcon
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now