Jump to content

Recommended Posts

I can not get this to function. Can a macro be tested in an if statement like below:

$lockdate = "365" ; Use 90, 180, 270, 365 (assume no leap year)

MsgBox(0,"Info", "Lockdate is " & $lockdate & @CRLF & "Today is " & @YDAY, 5)

If @YDAY > $lockdate Then

MsgBox(0,"Info", "OK", "Good")

Else

MsgBox(0,"Error", "Application has Expired", "Goodbye!!", 5)

Exit

EndIf

I get an expression error that point to the @YDAY macro.

Me

Link to post
Share on other sites

My test always show the application has failed. Is @YDAY and $lockdate considered integers and can therefore be compared?

$lockdate = "360" ; Use 90, 180, 270, 365 (assume no leap year)

MsgBox(0,"Info", "Lockdate is " & $lockdate & @CRLF & "Today is " & @YDAY, 5)

If @YDAY >= $lockdate Then

MsgBox(0,"Info", "test", "Goodbye!!")

Else

MsgBox(0,"Error", "Application has Expired", "Goodbye!!")

Exit

EndIf

CC

Link to post
Share on other sites

My test always show the application has failed. Is @YDAY and $lockdate considered integers and can therefore be compared?

$lockdate = "360" ; Use 90, 180, 270, 365 (assume no leap year)

MsgBox(0,"Info", "Lockdate is " & $lockdate & @CRLF & "Today is " & @YDAY, 5)

If @YDAY >= $lockdate Then

MsgBox(0,"Info", "test", "Goodbye!!")

Else

MsgBox(0,"Error", "Application has Expired", "Goodbye!!")

Exit

EndIf

CC

This works for me, but you have the forth parameter in the msgbox calls as a string but it should be an integer for the time out.
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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...