Jump to content

LockDate


Recommended Posts

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.

Link to comment
Share on other sites

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 by pezo89
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...