Jump to content

how con this be done


n9mfk9
 Share

Recommended Posts

  • Developers

I need to write a script that can tell me the date of

last Wednesday of the month that has a Thursday after

thanks for any ideas

<{POST_SNAPBACK}>

This should work :lmao:

#include <date.au3>

for $x = 1 to 12
    Msgbox(0,'get last wednesday','last Wednesday which has a following thursday in the same month for month:' & $x & @lf & Find_Last_Wedthu_of_month(2005,$x))
next 

Func Find_Last_Wedthu_of_month($year,$month)
    For $day = _DateDaysInMonth($year,$month) to 1 step -1
        If _DateToDayOfWeek($year,$month,$day) = 5 Then
            return $day-1
        EndIf
    Next
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

there one question

how cold i make $j be just the date that the script come um with

<{POST_SNAPBACK}>

:lmao: could you explain what you mean ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

:lmao: could you explain what you mean ?

<{POST_SNAPBACK}>

hi jdeb

here is what i did it gives me what i wet but insted of have a msg box i wet to make it $j so in a script

shanks beau

#include <date.au3>

$x = @MON

Msgbox(0,'','' & Find_Last_Wedthu_of_month(@YEAR,$x))

Func Find_Last_Wedthu_of_month($year,$month)

For $day2 = _DateDaysInMonth($year,$month) to 1 step -1

If _DateToDayOfWeek($year,$month,$day2) = 5 Then

return $day2-1

EndIf

Next

EndFunc

Link to comment
Share on other sites

  • Developers

something like:

#include <date.au3>

$j = Find_Last_Wedthu_of_month(@YEAR,@MON)

Func Find_Last_Wedthu_of_month($year,$month)
    For $day = _DateDaysInMonth($year,$month) to 1 step -1
        If _DateToDayOfWeek($year,$month,$day) = 5 Then
            return $day-1
        EndIf
    Next
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

looks like you need a program to do that sort of thing

<{POST_SNAPBACK}>

what's wrong with this autoit program ? :lmao:o:) Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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