Jump to content

timer issue


shornw
 Share

Recommended Posts

can anyone point out to me why this wont work. I'm probably missing something really basic.... but I keep missing it. If I run the file after

$t1 = "15:00"
$ct = @hour&":"&@MIN

While 1

If $ct=$t1 Then
      MsgBox(0, "", "Times match")
EndIf

Wend

If I run the script before 15:00, the time passes without the MsgBox appearing. If I run the script at 15:00 it will run but the MsgBox is still generated after 15:01

Any help appreciated

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Link to comment
Share on other sites

can anyone point out to me why this wont work. I'm probably missing something really basic.... but I keep missing it. If I run the file after

$t1 = "15:00"
$ct = @hour&":"&@MIN

While 1

If $ct=$t1 Then
      MsgBox(0, "", "Times match")
EndIf

Wend

If I run the script before 15:00, the time passes without the MsgBox appearing. If I run the script at 15:00 it will run but the MsgBox is still generated after 15:01

Any help appreciated

It will only match if you start the script at 15:00. Try tthis

$t1 = "15:00"

While 1
$ct = @hour&":"&@MIN
If $ct=$t1 Then
      MsgBox(0, "", "Times match")
EndIf

Wend
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

That's really helpful. Thank you. Hindsight is always 20-20 but of course in the original form it doesn't update the variable $ct DOH!!!!

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

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...