Sign in to follow this  
Followers 0
jbennett

@WDAY Issue

18 posts in this topic

#1 ·  Posted (edited)

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

Edited by jbennett

Share this post


Link to post
Share on other sites



$WDAY = @WDAY

now work with the variable

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

would it not be possible to do the following

$WeekDays = 1 & 2 & 3

@wday=$weekdays

???

Cheers

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Read only explain itself

Share this post


Link to post
Share on other sites

Just had a look at the macros but that just shows @WDAY in the list.

Not sure of a way around this?

thanks

Share this post


Link to post
Share on other sites

what u want to do?

Share this post


Link to post
Share on other sites

I can't figure out what you are trying to accomplish, be more descriptive.

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

so why do u need to modify @WDAY ?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I had to look up the definition of hirsute.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

You should have asked me, it's a suit that a woman wears.

:P

Share this post


Link to post
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

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