Sign in to follow this  
Followers 0
Diana (Cda)

Date restriction not working here. Script runs every

23 posts in this topic

The beginning part of a script I have should restrict the script to work only between December 1st and December 25th. This syntax was kindly given to me but now that I'm using it, find that it doesn't work. This script runs every day even thought we were in May. How can this be fixed, pls?

#include <Date.au3>
$StartTime = "06:00"     ;  adjust START time here in 24-hour time
$EndTime = "23:59"     ;  adjust END time here in 24-hour time
$CurrentTime = _NowTime(4)

If @MON = 12 and @MDay >=1 and @MDay <=25 Then     ; Advent event will run from December 1st to the 25th!
If $CurrentTime >= $StartTime AND $CurrentTime <= $EndTime Then
;It's not a valid time for script to run so exit without running
    Exit
EndIf
EndIf
; ========== My script down below: ===========================================================

Thanks! :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The beginning part of a script I have should restrict the script to work only between December 1st and December 25th. This syntax was kindly given to me but now that I'm using it, find that it doesn't work. This script runs every day even thought we were in May. How can this be fixed, pls?

#include <Date.au3>
$StartTime = "06:00"     ;  adjust START time here in 24-hour time
$EndTime = "23:59"     ;  adjust END time here in 24-hour time
$CurrentTime = _NowTime(4)

If @MON = 12 and @MDay >=1 and @MDay <=25 Then     ; Advent event will run from December 1st to the 25th!
If $CurrentTime >= $StartTime AND $CurrentTime <= $EndTime Then
;It's not a valid time for script to run so exit without running
    Exit
EndIf
EndIf
; ========== My script down below: ===========================================================

Thanks! :)

Hi Diana,

I think that script has more code than is required;

If @Mon <> 12 OR @Hour < 6 OR @Mday > 25 Then Exit;; If it's not December it exits and it will exit any time before 6AM even if it is December and it must be before the 26th of the month.

You don't need the 23:59 The next hour is 0 which again is less than 6. This could be even simpler if I knew what was down below. If it jumps straight to a function then it can be simplified.

Edit; I should have also pointed out that _NowTime(4) returns a string and you can not perform math operations on it because of the colon.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe something like this?

(I was reading the Date UDF's examples)

Below is only the function and the includes, use them to write an example if you want, but read the comments first.

#include <Date.au3>
Func _Timed_License($start, $end)
    ;Inputs -  $start and $end are in the format       YYYY/MM/DD HH:MM:SS
    ;Outputs - License has not begun yet(Negative);  License is Valid(Zero);  License has expired(Positive)
    Local $ds, $dm, $de
    Local $EPOCH="1970/01/01 00:00:00"
    $ds=_DateDiff('s',$EPOCH, $start)
    $dm=_DateDiff('s',$EPOCH, _NowCalc())
    $de=_DateDiff('s',$EPOCH, $end)
    If $dm<$ds Then Return ($dm-$ds)
    If $dm>$de Then Return ($dm-$de)
    Return 0
EndFunc

Returns:

Negative Value - Number of seconds until the license is valid.

Zero Value - The License is valid

Positive Value - Number of seconds since the license was valid.

EDIT: updated to return the AMOUNT of time outside of the license that the date is.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi Diana,

I think that script has more code than is required;

If @Mon <> 12 OR @Hour < 6 OR @Mday > 25 Then Exit;; If it's not December it exits and it will exit any time before 6AM even if it is December and it must be before the 26th of the month.

You don't need the 23:59 The next hour is 0 which again is less than 6. This could be even simpler if I knew what was down below. If it jumps straight to a function then it can be simplified.

Edit; I should have also pointed out that _NowTime(4) returns a string and you can not perform math operations on it because of the colon.

Hi! Thanks so much for your response!

<g> Where the start and end times go?????? <g> Just to say before 6 a.m. is no good. This particular script here happens to run between 6 a.m. and midnight (whereas just saying <6 means BETWEEN midnight and 6 a.m. when it actually shouldn't run <g>!!), but sometimes the start and end times are very different. I need to be able to have the flexibility to determine beginning and end. Other ones run from, say 17h00 and 21h00, for example Friday to Sunday night. The code for that is different as there are weekday codes in those ones. This is the only one I have that should be controlled by which month it is and the dates during that month. Re that, just saying >25 is no good and is in fact the wrong control. This script should run between December 1st and 25th, _not_ after the 25th <g>! But it might have been between, say, February 16 to the 21st, so start and ends needed here, too! Too funny.

I use these scripts with a scheduler and the way it works is that this script, as an example, is invoked to run every x number of hours every single day, the exact frequency needed _once_ the date and time control conditions are met; in this particular case, it should be such that it runs _only_ when it is any day between December 1st and 25th and between 06h00 and 23h59.

The rest of the script is the reminder part itself and it's not actually relevant here, believe it or not <vbg>.

I use these types of scripts with a freeware scheduler application that is as deficient as most of them are, even the fancy shareware ones. Like all apps I eventually keep and use all the time, I've tried literally dozens and dozens and dozens of them. I wouldn't be surprised if the number of shedulers I've tried over the years isn't above 50 in number! And I still am using the one that I have! Even Outlook's calendar cannot do what the combination of my freeware scheduler and date/time restricted AutoIt files can do. The freeware is so perfect in any other way that it's the ideal vehicle to do the job with. It can be set with the usual rudimentary day and time conditions. But none of them have ever had the flexibility of running a voice and/or launching etc. reminder from, say, only Saturday and Sundays every 6 hours every 3 weeks BETWEEN only 1 p.m. and 5 p.m. By setting all the conditions up in the scheduler that are possible, and _then_ having the rest of the conditions set down in a script that is launched by that app, that has made for a perfect scheduling/reminder/launching solution.

I restrict all my other scripts to run during certain hours on certain days in a similar way and have the scheduler run every x hours, etc. Since my computer is on overnight, when I didn't have this control, I'd have irrelevant voice reminders and launched items being forced to come on during hours when it wasn't needed and once in a while was woken up by the damn voice <g>.

The problem is that the script shouldn't be running now. I didn't write this code so I don't know where the problem lies. All the other scripts I have that are restricted differently by the days of the week _and_ time etc. and not to a specific time of year, all those _do_ work. But the syntax here is different enough that I don't know why this one doesn't.

Thanks much. :)

Edited by Diana (Cda)

Share this post


Link to post
Share on other sites

Maybe something like this?

(I was reading the Date UDF's examples)

Below is only the function and the includes, use them to write an example if you want, but read the comments first.

#include <Date.au3>
Func _Timed_License($start, $end)
    ;Inputs -  $start and $end are in the format       YYYY/MM/DD HH:MM:SS
    ;Outputs - License has not begun yet(Negative);  License is Valid(Zero);  License has expired(Positive)
    Local $ds, $dm, $de
    Local $EPOCH="1970/01/01 00:00:00"
    $ds=_DateDiff('s',$EPOCH, $start)
    $dm=_DateDiff('s',$EPOCH, _NowCalc())
    $de=_DateDiff('s',$EPOCH, $end)
    If $dm<$ds Then Return ($dm-$ds)
    If $dm>$de Then Return ($dm-$de)
    Return 0
EndFunc
...
Hi there! Very interesting.

I can't read code yet like Neo does (from the movie ... <g>) so can't really tell but I think I'm getting the gist of it. Brings up interesting point. I haven't yet ever needed to restrict scripts by either years or seconds, but who knows in the future. Excellent points to keep in mind. Very cool.

Can this be modified to not have years and seconds in there, I wonder ...

I'm not sure how to edit this script. I'm in over my head, which happens still very frequently. So I'll go off and play around with this and see what trouble I can get into while I try to figure out if I can get this to work <bg>

One thing I do know, in the early days when earlier code had a func code in it, lots of trouble if the rest of the code that eventually is invoked relied on func to do its job. Always had errors with the 2 func in there. That's why the code in my initial post above turned out to be such a godsend since no func anywhere! <g> (Sounds funky ... <g>)

But going off to give this a shot anyway ...

Thanks; much appreciated! :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If @Mon <> 12 OR @Hour < 6 OR @Mday > 25 Then Exit;; If it's not December it exits and it will exit any time before 6AM even if it is December and it must be before the 26th of the month.
Hmmm, just read this again much more carefully just now. How come the < and > symbols seem to say the opposite! Yet your comments in the script say it should work. It really looks to me like this would run contrary to the days and times needed ... Hmmmm ... Most confusing. I definitely must have starts and ends, of course, but just looking at this example, I find I can't see it working. <sigh> Must be me ... Still, I better go and actually test this. (Perhaps it might be good for other scripting needs.) :) Edited by Diana (Cda)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hmmm, just read this again much more carefully just now. How come the < and > symbols seem to say the opposite! Yet your comments in the script say it should work. It really looks to me like this would run contrary to the days and times needed ... Hmmmm ... Most confusing. I definitely must have starts and ends, of course, but just looking at this example, I find I can't see it working. <sigh> Must be me ... Still, I better go and actually test this. (Perhaps it might be good for other scripting needs.) :)

The date and time have to match or it exits. What it really says is

If @Mon NOT egaul to 12 Then Exit

If @Hour Less Than 6 Then Exit

If @MDay greater than 25 Then Exit

Just used the OR's to make sure that it matched all the conditions.

Edit: That's why I said if I knew what happenned next I would have written it differently.

If @Mon = 12 AND @Hour > 6 And @Mday <= 25 Then
   myFunction()
Else
   Exit
EndIf
But I don't know if you actually call a function when you want it to run.

Edit 2: Brain Dead today. You could still use the second method even without calling a function.

If @Mon = 12 AND @Hour > 6 And @Mday <= 25 Then
 ;;Run your code here
Else
   Exit
EndIf

Edit 3:

There are just so many ways to do this. Here is another one. Create a new function as follows

Func _ValRun()
   If @Mon = 12 AND @Hour > 6 And @Mday <= 25 Then
      Return 1
   Else
      Return 0
   EndIf
EndFunc

Then replace all of the code in your first post with

If NOT _ValRun() Then Exit

EndFunc

You could even use something like

Do
   Sleep (10000);; Check every 10 seconds
Until _ValRun() = 1
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Edit 2: Brain Dead today. You could still use the second method even without calling a function.

ME, TOO! <g>

That's the trouble. There are so many ways, but nothing seems easy to use and edit. Here, I'll show you another script template I use. You'll see how easy it is to come back and use the code over and over again. Making changes is easy.

Here's the case

;
; AutoIt v3.0
;
AutoItSetOption("WinTitleMatchMode", 2)     ; this allows partial window titles to be valid!
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

#include <Date.au3>
$StartTime = "11:00"     ;  adjust START time here in 24-hour time
$EndTime = "23:59"       ;  adjust END time here in 24-hour time
$CurrentTime = _NowTime(4)

Switch @WDAY ; list days script allowed to run (allows for multiple days allowed, just uncomment ';' Case line)
    ;  -  ANY "Case" BELOW THAT DOES _NOT_ HAVE A ";" IN FRONT WILL BE ALLOWED.
    ;  -  MORE THAN ONE DAY CAN BE 'UNCOMMENTED', BY REMOVING THE ";" IN FRONT!
    ;  -  i.e.,     Day(s) shown with "Case #" allowed  --  day(s) shown with ";Case #", with semi-colon in front, NOT allowed.
    Case 1     ;  Sunday
;    Case 2     ;  Monday
;    Case 3     ;  Tuesday
;    Case 4     ;  Wednesday
    Case 5     ;  Thursday
    Case 6     ;  Friday
    Case 7     ;  Saturday 
        Case Else     ;  any day not listed in case structure
            ;'FreeRange' Time
        Exit
EndSwitch

If Not ($CurrentTime >= $StartTime AND $CurrentTime <= $EndTime) Then
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf
; ========== My script down below: ===========================================================

Again, since this part of the script determines whether the rest of the script runs, it's not important to know the rest, it's just to make sure that it stands alone. In other words, no code after (such as when func was used to restrict date and/or time). Some of the others code uses func and so create unnecessary complications. So best to have my code always come at the end of the restrictive code.

The above scipt is probably clunky by many people's standards, but it works. I just tick off/change whatever I need to to make each particular case work. i.e., there are some scripts that only run on, say, Tuesdays. I comment out all the other days. And it's so, so easy to make the range of time since I just have to input a start time and an end time.

None of the examples I've seen for this issue today are as easy to edit.

Herer's

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I didn't want to see your code. I just wanted to figure out if you were jumping to a function or straight to lines of code.

I'm not too sure why the code in your last post is working because logicaly it should fail for the same reason I outlined before (>= and <= are math operators and _NowTime(4) returns a string) I don't see how you figure the solutions I gave are more difficult to change than your last example. Just change any of the numbers. For your last code I would have written that using either of the last 2 methods I posted.

;
; AutoIt v3.0
;
AutoItSetOption("WinTitleMatchMode", 2); this allows partial window titles to be valid!
#NoTrayIcon; AutoIt's icon doesn't show in systray

#include <Date.au3>

;;$StartTime = "11:00";  adjust START time here in 24-hour time
$StartTime = 11; Start at 11 AM
;; Next 2 lines not required 
;;$EndTime = "23:59";  adjust END time here in 24-hour time
;;$CurrentTime = _NowTime(4)

Switch @WDAY; list days script allowed to run (allows for multiple days allowed, just uncomment ';' Case line)
;  -  ANY "Case" BELOW THAT DOES _NOT_ HAVE A ";" IN FRONT WILL BE ALLOWED.
;  -  MORE THAN ONE DAY CAN BE 'UNCOMMENTED', BY REMOVING THE ";" IN FRONT!
;  -  i.e.,  Day(s) shown with "Case #" allowed  --  day(s) shown with ";Case #", with semi-colon in front, NOT allowed.
    Case 1;  Sunday
;   Case 2;  Monday
;   Case 3;  Tuesday
;   Case 4;  Wednesday
    Case 5;  Thursday
    Case 6;  Friday
    Case 7;  Saturday 
        Case Else;  any day not listed in case structure
        ;'FreeRange' Time
        Exit
EndSwitch
;; Next line modified
;If Not ($CurrentTime >= $StartTime AND $CurrentTime <= $EndTime) Then
If @Hour < $StartTime Then
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf
; ========== My script down below: ===========================================================

Or

;
; AutoIt v3.0
;
AutoItSetOption("WinTitleMatchMode", 2); this allows partial window titles to be valid!
#NoTrayIcon; AutoIt's icon doesn't show in systray

#include <Date.au3>

;;$StartTime = "11:00";  adjust START time here in 24-hour time
$StartTime = 11; Start at 11 AM
;; Next 2 lines not required 
;;$EndTime = "23:59";  adjust END time here in 24-hour time
;;$CurrentTime = _NowTime(4)

Switch @WDAY; list days script allowed to run (allows for multiple days allowed, just uncomment ';' Case line)
;  -  ANY "Case" BELOW THAT DOES _NOT_ HAVE A ";" IN FRONT WILL BE ALLOWED.
;  -  MORE THAN ONE DAY CAN BE 'UNCOMMENTED', BY REMOVING THE ";" IN FRONT!
;  -  i.e.,  Day(s) shown with "Case #" allowed  --  day(s) shown with ";Case #", with semi-colon in front, NOT allowed.
    Case 1;  Sunday
;   Case 2;  Monday
;   Case 3;  Tuesday
;   Case 4;  Wednesday
    Case 5;  Thursday
    Case 6;  Friday
    Case 7;  Saturday 
        Case Else;  any day not listed in case structure
        ;'FreeRange' Time
        Exit
EndSwitch
;; Next line modified
;If Not ($CurrentTime >= $StartTime AND $CurrentTime <= $EndTime) Then
If NOT  _ValRun() Then
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf

Func _ValRun()
   If @Hour >= $StartTime Then
      Return 1
   Else
      Return 0
   EndIf
EndFunc
; ========== My script down below: ===========================================================
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Also (I'm not trying to confuse you here) the Switch statement that you have could have easily been replaced with a StringInStr().

;
If NOT StringInStr("1567", @WDay) Then Exit;; Where 1567 is the days that you want it to run
#cs
Switch @WDAY; list days script allowed to run (allows for multiple days allowed, just uncomment ';' Case line)
;  -  ANY "Case" BELOW THAT DOES _NOT_ HAVE A ";" IN FRONT WILL BE ALLOWED.
;  -  MORE THAN ONE DAY CAN BE 'UNCOMMENTED', BY REMOVING THE ";" IN FRONT!
;  -  i.e.,  Day(s) shown with "Case #" allowed  --  day(s) shown with ";Case #", with semi-colon in front, NOT allowed.
    Case 1;  Sunday
;   Case 2;  Monday
;   Case 3;  Tuesday
;   Case 4;  Wednesday
    Case 5;  Thursday
    Case 6;  Friday
    Case 7;  Saturday 
        Case Else;  any day not listed in case structure
      ;'FreeRange' Time
        Exit
EndSwitch
#ce
;
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

<g> I know people aren't trying to confuse me, but it happens! <g> One day, I'll be much more like Neo from the movie and will be able to "read" the code much better. But I'm still just plowing through all this as best I can. But that brings me back to the example code above. A kind person gave me that excellent format that is so very easy to edit. And it works!

I can't stress enough how important that _both_ times be clearly marked, as in the example script and that they be in HH:mm format. I guess I've failed again to explain, which is so easy to do. This script is not for a one-time use. Like the example code, it's built in such a way that it's easy to recycle. Since this time/date restriction part is for use with future scheduling scripts, I will use this again and again even though this particular format today with an actual date restriction won't be used as much as the example one is used. So sometimes the end and start times are very specific. Just saying before a certain hour just isn't enough.

Hmmm, wracking my brain. Perhaps a different approach would work. Perhaps this will better underline what I've been hoping for as an end result that I'm too dumb in AI to figure out on my own <g>. TIME-DATE RESTRICTION TO PUT IN FRONT OF SCRIPTS TO DETERMINE WHETHER THEY RUN OR NOT (but with no Func coding since second part of scripts sometimes also have Func in them which always seems to conflict.):

Script should only run if during this time, START time:  HH:mm
Script should only run if during this time, END time:  HH:mm

Must also only run between this month and day, START date:  MM, DD (i.e, 12 for December, 1 for the 1st, say)
Must also only run between this month and day, END date:  MM, DD (i.e., December 25) - in whatever date/day code format it should be.  Just illustrating here with "MM, DD"

If above conditions met, then rest of script follows (script ends here so nothing else is needed at end to make this work).
; ======= MY SCRIPT BELOW ================================================================================================


...

The example script above is different but with the same purpose. I open up a previous one and copy the first bit and then change start and end times and comment in/comment out the days of the week, as needed. Then I dump the rest of the code it controls at the bottom. It's sooo simple and straightforward. And it works! I've switched over all my scheduling scripts to this since my launcher/scheduler is as deficient as all such apps are, even the payware ones.

With the help of AI, I now have reminders as complex as the example I gave above: run only, say, every 6 months during 4:17 p.m. and 10:54 p.m. only on Wednesdays and Fridays.

With this also is another enormous benefit; my scheduler's relative path capabilities are very clunky but there was code for that anyway. I call each script using relative path syntax and then the task in the scripts use AutoIt fantastic relative path capabilities. With this combination I have had for months an excellent and completely flexible system that means I'm up and running now the instant I sit down at a new computer at work or I start a new job contract, and plug in my USB flash drive!!!! Completely awesome.

The use for the code today is silly, of course. It's just a voice and launching reminder in December before Xmas that pops up a program that speaks out an advent message. This reminder had been lost but ever since I put in an earlier backup of my sheduler after an OS crash and reinstall this weekend, it's been popping up every day during the start/end times <g>. So the date/day restriction isn't working here since it should only do so during those times between Dec.01-25. Because I foresee needing similar code, would like to resolve this one.

Thanks much! I really, really appreciate everyone's help. :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Well, since you insist on having that colon in there, and we can't perform math on it, just leave it with me for now. After I have my morning coffee jolt I'll see what I can do. By then the brain may actually be functional again.

Edit: Just a quick note; It may have been easier to re-write your scheduler :)

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Well, since you insist on having that colon in there, and we can't perform math on it, just leave it with me for now. After I have my morning coffee jolt I'll see what I can do. By then the brain may actually be functional again.

How the morning coffee thing go? <g> Were things better after that? <g>

Edit: Just a quick note; It may have been easier to re-write your scheduler :)

HAH! For _YOU_ maybe!!! <lol> Us non-programming types have to work with what tools there are, which is sometimes so damn little ... "may have been easier to re-write your scheduler ...", my @$$ <vbg>!! Yeah, yeah, I don't doubt it for some; but in my own defense, this works! It took a lot of time and help to come up with a working model of my idea but the rest is absurdly simple. A quick copy/paste then quick edit of days and times and the rest of the actual reminder code is then simply dumped in after that. The thing you may not be grasping is that the rest of the scripts can involve complex launching and voice prompts that run in a certain sequence, etc. There ain't no app out there that comes close to what PowerPro's scheduler with AutoIt scripts can do! I dare anyone to find something that can do what this combo does!!! I have years of looking for such an app before I struck out on my own once I was minimally competent enough in AI to even attempt this! <g>

Also, one day there will be more portable apps that are truly portable and not just standalones, the latter of which tend to have little true success at behaving the way they should. There are problems with about 98% of all so-called portable apps, I've found, even when they come from dedicated portable app sites! <grr> First time you move to another computer after setting up and they stop working properly!!

Even if one could even find an easy-to-use scheduler that did allow you to specify do something like, say, "run reminder/voice prompt _only_ on Saturdays from 9 a.m. to 5 p.m.", etc., 100 to 1 it ain't portable! <g> Even then I'd still have to use AI code anyway so the scheduler part is a moot point to begin with. My needs are simple but too complex for even the best shareware/commercialware I've trialed.

So, anyway, have been mulling this over in my head since my last post. I have other needs that I've remembered which would be 100 times easier to deal with if they were electronic. So took apart one of the formats that actually does work for restricting running only if certain start and end days/times. I tried re-writing it and thought I had something that might work. It actually doesn't and I don't know why. But I have the format down now exactly to what I'm hopeful of seeing in the end result. It's in an easy-to-understand at first glance format that would allow for easy re-use in future. If only it worked! <sigh> The script _still_ goes on to do the rest of its task even when date/time conditions not met.

I've truncated the remainder of the script since not important at this point. I've left in this example the part that starts to play "Deck the Halls" beep music when it shouldn't, just so one can tell when it does work. Also, couldn't figure out how to restrict to a month or region of months (i.e., either just 1 month or range of months, i.e., from March to July). I would usu. only need to put the start and end month as the same month but you never know, and I feel it should be scripted to be able to accommodate a range even if I can't think of a reason why I'd need that now. But best to put that in there, anyway.

;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

; =================================================================================================
#include <Date.au3>
$TIMEstart = "10:16"     ;  adjust START time here in 24-hour time
$TIMEend = "23:59"     ;  adjust END time here in 24-hour time
$current_TIME = _NowTime(4)
; ============================================================
$MONTHstart = 12     ; i.e., 1 = January
$MONTHend = 12     ; i.e., 1 = January; or could go for >1 month, so you can put a different ending month here

$DATEstart = 15     ; i.e., start on 10th of month = 10
$DATEend = 25     ; i.e., end on 15th of month = 15
$current_DATE = _NowDate()
; ============================================================

If NOT ($current_TIME >= $TIMEstart AND $current_TIME <= $TIMEend) AND ($current_DATE >= $DATEstart AND $current_DATE <= $DATEend) Then
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf
; =================================================================================================

#Include <Piano.au3>     ; beep music is for "Deck the Halls" Xmas carol
_59(400)
_57(200)
_56(300)
_54(300)
_52(300)
_54(300)
_56(300)
_52(300)
_R(50)
_54(150)
_56(150)
_57(150)
_54(150)
_56(400)
_R(50)
_54(200)
_52(300)
_51(300)
_52(500)
_R(100)

#cs
;

Can some kind soul let me know what I did wrong above and what to do to fix, pls?

Thanks a bunch; much appreciated! :)

Edited by Diana (Cda)

Share this post


Link to post
Share on other sites

How the morning coffee thing go? <g> Were things better after that? <g>

HAH! For _YOU_ maybe!!! <lol> Us non-programming types have to work with what tools there are, which is sometimes so damn little ... "may have been easier to re-write your scheduler ...", my @$$ <vbg>!! Yeah, yeah, I don't doubt it for some; but in my own defense, this works! It took a lot of time and help to come up with a working model of my idea but the rest is absurdly simple. A quick copy/paste then quick edit of days and times and the rest of the actual reminder code is then simply dumped in after that. The thing you may not be grasping is that the rest of the scripts can involve complex launching and voice prompts that run in a certain sequence, etc. There ain't no app out there that comes close to what PowerPro's scheduler with AutoIt scripts can do! I dare anyone to find something that can do what this combo does!!! I have years of looking for such an app before I struck out on my own once I was minimally competent enough in AI to even attempt this! <g>

Also, one day there will be more portable apps that are truly portable and not just standalones, the latter of which tend to have little true success at behaving the way they should. There are problems with about 98% of all so-called portable apps, I've found, even when they come from dedicated portable app sites! <grr> First time you move to another computer after setting up and they stop working properly!!

Even if one could even find an easy-to-use scheduler that did allow you to specify do something like, say, "run reminder/voice prompt _only_ on Saturdays from 9 a.m. to 5 p.m.", etc., 100 to 1 it ain't portable! <g> Even then I'd still have to use AI code anyway so the scheduler part is a moot point to begin with. My needs are simple but too complex for even the best shareware/commercialware I've trialed.

So, anyway, have been mulling this over in my head since my last post. I have other needs that I've remembered which would be 100 times easier to deal with if they were electronic. So took apart one of the formats that actually does work for restricting running only if certain start and end days/times. I tried re-writing it and thought I had something that might work. It actually doesn't and I don't know why. But I have the format down now exactly to what I'm hopeful of seeing in the end result. It's in an easy-to-understand at first glance format that would allow for easy re-use in future. If only it worked! <sigh> The script _still_ goes on to do the rest of its task even when date/time conditions not met.

I've truncated the remainder of the script since not important at this point. I've left in this example the part that starts to play "Deck the Halls" beep music when it shouldn't, just so one can tell when it does work. Also, couldn't figure out how to restrict to a month or region of months (i.e., either just 1 month or range of months, i.e., from March to July). I would usu. only need to put the start and end month as the same month but you never know, and I feel it should be scripted to be able to accommodate a range even if I can't think of a reason why I'd need that now. But best to put that in there, anyway.

;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

; =================================================================================================
#include <Date.au3>
$TIMEstart = "10:16"     ;  adjust START time here in 24-hour time
$TIMEend = "23:59"     ;  adjust END time here in 24-hour time
$current_TIME = _NowTime(4)
; ============================================================
$MONTHstart = 12     ; i.e., 1 = January
$MONTHend = 12     ; i.e., 1 = January; or could go for >1 month, so you can put a different ending month here

$DATEstart = 15     ; i.e., start on 10th of month = 10
$DATEend = 25     ; i.e., end on 15th of month = 15
$current_DATE = _NowDate()
; ============================================================

If NOT ($current_TIME >= $TIMEstart AND $current_TIME <= $TIMEend) AND ($current_DATE >= $DATEstart AND $current_DATE <= $DATEend) Then
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf
; =================================================================================================

#Include <Piano.au3>     ; beep music is for "Deck the Halls" Xmas carol
_59(400)
_57(200)
_56(300)
_54(300)
_52(300)
_54(300)
_56(300)
_52(300)
_R(50)
_54(150)
_56(150)
_57(150)
_54(150)
_56(400)
_R(50)
_54(200)
_52(300)
_51(300)
_52(500)
_R(100)

#cs
;

Can some kind soul let me know what I did wrong above and what to do to fix, pls?

Thanks a bunch; much appreciated! :)

I've had several coffee jolts since then but no help there. I think, however, that I did find a possible solution. I am going to PM you with a couple of questions and your answers will determine if my thinking is good or bad. The fact that I'm thinking at all is a good start so maybe we will get lucky here.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Maybe this piece of code is what you are looking for...

(It's not the best example of coding but it makes things very easy to understand)

#include <Date.au3>
$Starthh = 06
$Startmm = 00   
$Endhh = 23     
$Endmm = 00
$RunInMonth = 6
$DayOfMonthStart = 1
$DayOfMonthEnd = 25

;Check if the current month is OK
If @MON <> $RunInMonth Then
    MsgBox(0,"Invalid month detected." & " Current Month is: " & @MON ,"Quiting...",10)
        Exit
    Else
        MsgBox(0,"Valid month detected." & " Current Month is: " & @MON,"Proceeding with day of month check",10)
EndIf

;Check if the current Day Of Month is OK
If @MDay < $DayOfMonthStart and @MDay > $DayOfMonthEnd Then 
        MsgBox(0,"Invalid day of month detected." & " Current day of month is: " & @MDAY,"Quiting...",10)
        Exit
    Else
        MsgBox(0,"Valid day of month detected." & " Current day of month is: " & @MDAY ,"Proceeding with hour boundary check",10)
EndIf   

;Check if the current Hour is OK
If @HOUR < $Starthh AND @HOUR > $Endhh Then
    MsgBox(0,"Invalid Hours detected","Quiting...",10)
        Exit
    Else
        MsgBox(0,"Valid Hours detected","Proceeding with minutes boundary check",10)
EndIf
    
;Check if the current Minutes are OK
If @MIN >= $Startmm And @MIN <= $Endmm Then
    MsgBox(0,"Invalid Minutes detected","Quiting...",10)
        Exit
    Else
        MsgBox(0,"Valid Minutes detected","Proceeding with program....",10)
EndIf
    
Beep(500,250)
Edited by Scriptonize

If you learn from It, it's not a mistake

Share this post


Link to post
Share on other sites

Sometimes things can be a little frustrating, eh? <g>

I was really hoping to keep the same format as the code that is already working rather than doing up a whole new approach. Again, this code just sets out conditions that must be met for any script dumped in afterward to work. If the conditions are met then any script placed after can run. In this case, unlike most of my scripts, there is an additional restriction on the month for the script to run as well as a range of dates. By putting a start and end MONTH and a start and end DATE, i.e., 1 to 31, this gives me ability to even have a valid start date that goes across a range of dates, as well: i.e., script should only run, say, between Jun.27 and Jul.03 between 7 p.m. and 8:25 p.m. (just an example).

Having a simple date/time restrictive code like I have here below would be the most ideal. It's based on code that already works and that uses HH:mm. What I have come to learn about AutoIt from receiving all the great help I have over time, is that AutoIt can do just about anything and with the simplest code imaginable. I have a couple of cases where I had really complex and unintuitive code to do something that I used for 2 years in one case and a year or so in another. That was great, they got the job done even though I couldn't edit the code myself without some help sometimes. With those 2 cases, during forum searches to find something else I then stumbled upon simpler, shorter syntax that I then incorporated into my original scripts that was shorter and more intuitive that I could definitely edit myself without help (like the 3rd type of restrictive date/time code. The original code was cumbersome, this type here below is not!). Go figure ... So I'm really hoping that someone will know a way to do what I'm trying to do yet keep the same type of basic structure re dates and times. Below is the easiest style to work with:

;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

; ================================================================================================
#include <Date.au3>
$TIMEstart = "10:16"     ;  adjust START time here in 24-hour time
$TIMEend = "23:59"     ;  adjust END time here in 24-hour time
$current_TIME = _NowTime(4)
; ============================================================
$MONTHstart = 12     ; i.e., 1 = January
$MONTHend = 12     ; i.e., 1 = January; or could go for >1 month, so you can put a different ending month here

$DATEstart = 15     ; i.e., start on 10th of month = 10
$DATEend = 25     ; i.e., end on 15th of month = 15
$current_DATE = _NowDate()
; ============================================================

If NOT ($current_TIME >= $TIMEstart AND $current_TIME <= $TIMEend) AND ($current_DATE >= $DATEstart AND $current_DATE <= $DATEend) Then
; above in English:  if right now when running script it is not the right date range (start and end date) AND the right time frame (start and end time) then the script will not run.
;  Conditions not met - so it's not a valid date & time for script to run; therefore, exit without continuing.
    Exit
EndIf
; ======= MY SCRIPT BELOW ============================================================================

I was the one who put in the _NowDate() code in there, following example of _nowTime(4) from working scripts but perhaps that is wrong (??). Again, style and format is ideal, but I'm not sure I have combined everything so that it actually works.

Thanks everyone! I really appreciate the help. I wish I could whip these things up myself but still have a lot of trouble wrapping my brain around syntax. But I have come really, really far with the group's help. Thanks and cheers! :)

Share this post


Link to post
Share on other sites

Next question.

Is there a particular need for using _NowDate() or is just the Month and Month day sufficient?

The time function is done and works with any 24 hour format including the "06h00" style. I'm working on the date part now.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Next question.

Is there a particular need for using _NowDate() or is just the Month and Month day sufficient?

The time function is done and works with any 24 hour format including the "06h00" style. I'm working on the date part now.

Nah, "my bad". As I just PM'd, other AI syntax doesn't matter. I understand only that there are rules to follow and I hope I get the right syntax so script will run but I don't yet know much beyond the scripts I now work with so I'm no "fan" of one thing over another. I don't even know a miniscule portion of possible AI syntax to begin with <bg>.

Wow, that's great! Fantastic to know that AI could recognize time in many guises, incl. 24-hour French-Canadian way of HHhmm. That's what I actually use myself long-hand with a pen whenever I write a time down. (Esp. useful on things like those itsy bitsy phone msg pads at office that we use to record messages for people that give you a measly 1/4" space to write day, date and time of message!!!! Getting to leave out a.m. and p.m. sure saves space!!)

But you know, I am used to using "06:00" rather than "06h00" all the time on the computer so it's actually what my eye and mind are trained to work with now. Since it turns out AI doesn't mind, can we leave it at HH:mm, by any chance?

You know, this is so dumb. We learn something new every day. Perhaps it would be better to see an English-language version of the script to better illustrate. I should have done that instead. <knock head on desk><sigh> Always there are ways to do things better, eh??!

Here is what I'm really hoping the script can do. The variables are in the ideal type of placement for me. It would make re-using the script really easy, esp. since I won't use it that often and will crack open a script to cannibalize the code after a long period away from it, and so I'll otherwise forget how to use anything more complex than this. I'd never forget how to re-use this as it's so incredibly straightforward to change:

;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

; ================================================================================================
#include <Date.au3>
$TIMEstart = "10:16"     ;  adjust START time here in 24-hour time
$TIMEend = "23:59"     ;  adjust END time here in 24-hour time
; ============================================================
$MONTHstart = 12     ; i.e., 1 = January, 2 = February, 3 = March, etc.
$MONTHend = 12     ; i.e., 1 = January; or could go for >1 month range, so you can put a different ending month here

$DATEstart = 15     ; i.e., start on 15th of month = 15
$DATEend = 25     ; i.e., end on 2th of month = 25
; ============================================================

IF not between the start TIME and end TIME AND if not between the start MONTH and end MONTH and if not between the start DATE and end DATE, then conditions not met and script below won't run.

; ======= MY SCRIPT BELOW ============================================================================

Whatever other filler code is needed to make the above work is absolutely fine. As long as the basic structure remains like above and the variables keep the format they're in, then whatever else is used "makes no never mind", as the old saying goes <g>!

What is important is the structure, to keep the variables as they are and the layout of each start and end on a line as is shown here and keeping the time format of HH:mm as is rather than complicating things by separating hours and minutes.

Thanks! The answer is just around the corner, I can feel it. It's just how to get the script to pay attention to 3 restrictions instead of just 2.

Cheers!! :)

Share this post


Link to post
Share on other sites

Nah, "my bad". As I just PM'd, other AI syntax doesn't matter. I understand only that there are rules to follow and I hope I get the right syntax so script will run but I don't yet know much beyond the scripts I now work with so I'm no "fan" of one thing over another. I don't even know a miniscule portion of possible AI syntax to begin with <bg>.

Wow, that's great! Fantastic to know that AI could recognize time in many guises, incl. 24-hour French-Canadian way of HHhmm. That's what I actually use myself long-hand with a pen whenever I write a time down. (Esp. useful on things like those itsy bitsy phone msg pads at office that we use to record messages for people that give you a measly 1/4" space to write day, date and time of message!!!! Getting to leave out a.m. and p.m. sure saves space!!)

But you know, I am used to using "06:00" rather than "06h00" all the time on the computer so it's actually what my eye and mind are trained to work with now. Since it turns out AI doesn't mind, can we leave it at HH:mm, by any chance?

You know, this is so dumb. We learn something new every day. Perhaps it would be better to see an English-language version of the script to better illustrate. I should have done that instead. <knock head on desk><sigh> Always there are ways to do things better, eh??!

Here is what I'm really hoping the script can do. The variables are in the ideal type of placement for me. It would make re-using the script really easy, esp. since I won't use it that often and will crack open a script to cannibalize the code after a long period away from it, and so I'll otherwise forget how to use anything more complex than this. I'd never forget how to re-use this as it's so incredibly straightforward to change:

;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon     ; AutoIt's icon doesn't show in systray

; ================================================================================================
#include <Date.au3>
$TIMEstart = "10:16"     ;  adjust START time here in 24-hour time
$TIMEend = "23:59"     ;  adjust END time here in 24-hour time
; ============================================================
$MONTHstart = 12     ; i.e., 1 = January, 2 = February, 3 = March, etc.
$MONTHend = 12     ; i.e., 1 = January; or could go for >1 month range, so you can put a different ending month here

$DATEstart = 15     ; i.e., start on 15th of month = 15
$DATEend = 25     ; i.e., end on 2th of month = 25
; ============================================================

IF not between the start TIME and end TIME AND if not between the start MONTH and end MONTH and if not between the start DATE and end DATE, then conditions not met and script below won't run.

; ======= MY SCRIPT BELOW ============================================================================

Whatever other filler code is needed to make the above work is absolutely fine. As long as the basic structure remains like above and the variables keep the format they're in, then whatever else is used "makes no never mind", as the old saying goes <g>!

What is important is the structure, to keep the variables as they are and the layout of each start and end on a line as is shown here and keeping the time format of HH:mm as is rather than complicating things by separating hours and minutes.

Thanks! The answer is just around the corner, I can feel it. It's just how to get the script to pay attention to 3 restrictions instead of just 2.

Cheers!! :)

The answer is just minutes away now that I have this info. As a matter of fact the time function worked so well I'm going to include it in my Time UDF. That one is done. I'll post them both together.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Using the following example that you posted

;
;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon; AutoIt's icon doesn't show in systray

; ================================================================================================
#include <Date.au3>
$TIMEstart = "10:16";  adjust START time here in 24-hour time
$TIMEend = "23:59";  adjust END time here in 24-hour time
; ============================================================
$MONTHstart = 12; i.e., 1 = January, 2 = February, 3 = March, etc.
$MONTHend = 12; i.e., 1 = January; or could go for >1 month range, so you can put a different ending month here

$DATEstart = 15; i.e., start on 15th of month = 15
$DATEend = 25; i.e., end on 2th of month = 25
; ============================================================

IF not between the start TIME and end TIME AND if not between the start MONTH and end MONTH and if not between the start DATE and end DATE, then conditions not met and script below won't run.

; ======= MY SCRIPT BELOW ============================================================================
;

This is what we now have

;
;----- Limits time this script will run to between the start and end date and times listed below: ------
#NoTrayIcon; AutoIt's icon doesn't show in systray

; ================================================================================================
#include <Date.au3>
$TIMEstart = "10:16";  adjust START time here in 24-hour time
$TIMEend = "23:59";  adjust END time here in 24-hour time
; ============================================================
$MONTHstart = 12; i.e., 1 = January, 2 = February, 3 = March, etc.
$MONTHend = 12; i.e., 1 = January; or could go for >1 month range, so you can put a different ending month here

$DATEstart = 15; i.e., start on 15th of month = 15
$DATEend = 25; i.e., end on 2th of month = 25
; ============================================================
If _Time_InRange($TIMEstart, $TIMEend) = 0 OR _
_Date_InRange($MONTHstart, $DATEstart, $MONTHend, $DATEend) = 0 Then Exit

Func _Time_InRange($sTime, $eTime)
  Local $vRange = 0, $cTime
  $cTime = Number(StringFormat(@Hour & "%02d",@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()

Func _Date_InRange($sMth, $sDay, $eMth, $eDay)
  Local $cDate, $sYear = Number(@Year), $eYear = $sYear
  Local $vRange = 0, $vStart = 0, $vEnd = 0
  $cDate = Number(@Mon & @MDay & @Year)
;; The next 4 lines simply allow you to input single digit months (6 instead of 06)
  $sMth = Number(StringFormat("%02d",$sMth))
  $sDay = Number(StringFormat("%02d",$sDay))
  $eMth = Number(StringFormat("%02d",$eMth))
  $eDay = Number(StringFormat("%02d",$eDay))
  If Number(@Mon) > $sMth Then $sYear += 1
  If $sMth > $eMth Then
    $eMth += 12
    $eYear += 1
  EndIf
  $sDate = $sMth & $sDay & $sYear
  $eDate = $eMth & $eDay & $eYear
  If ($cDate - $sDate) >= 0 AND ($eDate - $cDate) >= 0 Then $vRange = 1
  Return $vRange
EndFunc ;<==> _Date_InRange()
;

You can use either 1 or 2 digits for the date function and you can use any non-numeric separator for the time function.

Edit:

To avoid confusion, you can also call the functions like this

$vTm = _Time_InRange($TIMEstart, $TIMEend)

$vDt = _Date_InRange($MONTHstart, $DATEstart, $MONTHend, $DATEend)

If $vTm = 0 OR $vDt = 0 Then Exit

Edit2: Modified to make sure we were doing math with numbers and not with strings. It was working but sooner or later it would have failed for someone.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
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
Sign in to follow this  
Followers 0