pezo89 Posted March 19, 2011 Posted March 19, 2011 Hi, i am making a little script for work. but my question is how can i make the script not function after a spesific date`? only way i can tell is to have it draw the biosdates into an ini file, and check them up against ea. but as that requires the user to have the script running every day it is not the best option.. any ideas it is plain and simple a Lock/delete section of the script to make it unusable after a spesific date/month in advance, Thanks for any responses.
somdcomputerguy Posted March 19, 2011 Posted March 19, 2011 Two years here but you haven't found Macros and If..Then loops in the helpfile? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
pezo89 Posted March 19, 2011 Author Posted March 19, 2011 (edited) God point thanks for the help thou. however i have one issue thou when having the logical operator to check if value is higher, it also fails when it is the same, how can i bypass that? $date = @YEAR $date2 = @MON if $date2 <= 03 Then MsgBox(0,"Error","DAte over limit") endif Edited March 19, 2011 by pezo89
pezo89 Posted March 19, 2011 Author Posted March 19, 2011 Nvm figured it out final product $Enddate = 03 ;Put the enddate here $date2 = @MON ;Check against current month ;if the current date is higher than the current date, stop the program if $date2 <$Enddate Then MsgBox(0,"Error","DAte over limit") endif
somdcomputerguy Posted March 19, 2011 Posted March 19, 2011 Also take a look at the Date Management section in the User Defined Functions Reference section of the help file. This code, after some modification, may be useful to you too.;=============================================================================== ; Function Name: _Time_InRange() ; Description: Determine if the current time is within a given Range ; Syntax: _Time_InRange("Low time", "High time") ; Parameter(s): $sTime - Low end of the range (Start time) ; $eTime - High end of the range (End time) ; Requirement(s): ; Return Value(s): 1 if current time is within the range otherwise 0 ; Author(s): George (GEOSoft) Gedye ; Modification(s): Replaced _NowTime(4) With Formatted @Hour & @Min ; Note(s): This only uses Hours and Minutes ; Example(s): MsgBox(0, "Time is good", _Time_InRange("08:00", "23:59")) ;=============================================================================== Func _Time_InRange($sTime, $eTime) Local $vRange = 0, $cTime $cTime = Number(@Hour & @Min) If $cTime >= Number(StringFormat("%04d",StringRegExpReplace($sTime, "\D", ""))) AND _ $cTime <= Number(StringFormat("%04d",StringRegExpReplace($eTime, "\D", ""))) Then $vRange = 1 Return $vRange EndFunc ;<==> _Time_InRange() - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
pezo89 Posted March 19, 2011 Author Posted March 19, 2011 Heh, now that looks a shitload more complicated than mine lol il see if i can get it into my head while iv had some sleep lol.. for now my little "simple" version will do Thanks alot thou
somdcomputerguy Posted March 19, 2011 Posted March 19, 2011 Thanks alot thou You bet. Good luck. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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