Jump to content

@WDAY Issue


 Share

Recommended Posts

Hi,

Does anyone know how I can add more days to @WDAY

I was thinking @WDAY=1 & 2 & 3

But that doesn't seem to work

Thanks

I have often wondered how to get more days in the week but have never succeeded so far. :P

@WDAY read only variable which gives you the current day of the week. Look up Macros in the help.

If you want to have a variable to hold a number of days then you need to use your own variable.

$WeekDays = 1 & 2 & 3
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

would it not be possible to do the following

???

Cheers

Well I did say @WDAY is read only and I did say look up Macros in the help.

Read only has a special meaning but it's a bit complicated to explain. :P

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

Hi,

What I want my code to do is the following:

Check if it's Monday, Wednesday, Thursday or Friday

If it is these days then it runs a certain piece of code.

and my other piece of code checks if it's Tuesday and runs a piece of code (this ofcourse works perfectly with @wday)

Link to comment
Share on other sites

Hi,

What I want my code to do is the following:

Check if it's Monday, Wednesday, Thursday or Friday

If it is these days then it runs a certain piece of code.

and my other piece of code checks if it's Tuesday and runs a piece of code (this ofcourse works perfectly with @wday)

If StringInStr("2,4,5,6", String(@WDAY)) Then MsgBox(64, "Ta Da!", "It's Monday, Wednesday, Thursday, or Friday!")

Switch @WDAY
     Case 2,4,5,6
          MsgBox(64, "Ta Da!", "It's Monday, Wednesday, Thursday, or Friday!")
EndSwitch

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Switch @WDAY
      Case 2,4,5,6
          MsgBox(0,"","The current day is Monday, Wednesday, Thursday, or Friday")
      Case Else
          MsgBox(0,"","The current day is NOT Monday, Wednesday, Thursday, or Friday")
  EndSwitch

Damn penguin!

Edited by weaponx
Link to comment
Share on other sites

Switch @WDAY
      Case 2,4,5,6
          MsgBox(0,"","The current day is Monday, Wednesday, Thursday, or Friday")
      Case Else
          MsgBox(0,"","The current day is NOT Monday, Wednesday, Thursday, or Friday")
  EndSwitch

Damn penguin!

Damn hirsute ball of toothpicks!

If StringRegExp(String(@WDAY), "[2456]", 0) Then 
    MsgBox(64, "Ta Da!", "It's Monday, Wednesday, Thursday, or Friday!")
Else
    MsgBox(64, "Relax", "It's not Monday, Wednesday, Thursday, or Friday!")
EndIf

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I had to look up the definition of hirsute.

You should have asked me, it's a suit that a woman wears.
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

Damn hirsute ball of toothpicks!

If StringRegExp(String(@WDAY), "[2456]", 0) Then 
    MsgBox(64, "Ta Da!", "It's Monday, Wednesday, Thursday, or Friday!")
Else
    MsgBox(64, "Relax", "It's not Monday, Wednesday, Thursday, or Friday!")
EndIf

:(

Jesus... where did this come from? :P

Here's obfuscated version :idea:

$e = Not (StringRegExp(String(@WDAY), "[2456]", 0) And (MsgBox(64, "Ta Da!", "It's Monday, Wednesday, Thursday, or Friday!"))) And MsgBox(64, "Relax", "It's not Monday, Wednesday, Thursday, or Friday!")

♡♡♡

.

eMyvnE

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