Jump to content

_WeekNumber


Recommended Posts

#include <Date.au3>
;ConsoleWrite( _WeekNumberISO(2007,08,19) &@CRLF ); ( $iYear=@YEAR, $iMonth=@MON, $iDay=@MDAY )

ConsoleWrite( _WeekNumberr(2007,08,18) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,19) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,20) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,21) &@CRLF )

Func _WeekNumberr($Y, $M, $D)
$sJulDate = _DateToDayValue ($Y, $M, $D)
;MsgBox(4096, "", "Todays Julian date is: " & $sJulDate)
; 14 days ago calculation.
Dim $Y1, $M1, $D1
$sJulDate = _DayValueToDate ($sJulDate+1, $Y1, $M1, $D1)
Return _WeekNumberISO($Y1, $M1, $D1)
;MsgBox(4096, "", "14 days ago:" & $M & "/" & $D & "/" & $Y)
EndFunc

hmmm, going nutz my self here, ... and to discover that ERROR: _WeekNumber() already defined. , can it plz be added to the help file =/

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

#include <Date.au3>
;ConsoleWrite( _WeekNumberISO(2007,08,19) &@CRLF ); ( $iYear=@YEAR, $iMonth=@MON, $iDay=@MDAY )

ConsoleWrite( _WeekNumberr(2007,08,18) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,19) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,20) &@CRLF )
ConsoleWrite( _WeekNumberr(2007,08,21) &@CRLF )

Func _WeekNumberr($Y, $M, $D)
$sJulDate = _DateToDayValue ($Y, $M, $D)
;MsgBox(4096, "", "Todays Julian date is: " & $sJulDate)
; 14 days ago calculation.
Dim $Y1, $M1, $D1
$sJulDate = _DayValueToDate ($sJulDate+1, $Y1, $M1, $D1)
Return _WeekNumberISO($Y1, $M1, $D1)
;MsgBox(4096, "", "14 days ago:" & $M & "/" & $D & "/" & $Y)
EndFunc

hmmm, going nutz my self here, ... and to discover that ERROR: _WeekNumber() already defined. , can it plz be added to the help file =/

What are you trying to achive?? Is this a request for it to be added to the helpfile? Are you asking for help with your code?
Link to comment
Share on other sites

The function _WeekNumber() is in the Date.au3 standard UDF that comes with AutoIt:

;===============================================================================
;
; Function Name:    _WeekNumber()
; Description:      Find out the week number of current date OR date given in parameters
;
; Parameter(s):     $iDay    - Day value (default = current day)
;                   $iMonth    - Month value (default = current month)
;                   $iYear    - Year value (default = current year)
;                   $iWeekstart - Week starts from Sunday (1, default) or Monday (2)
; Requirement(s):
; Return Value(s):  On Success     - Returns week number of given date
;                   On Failure     - returns -1  and sets @ERROR = 1 on faulty parameters values
;                   On non-acceptable weekstart value sets @ERROR = 99 and uses default (Sunday) as starting day
; Author(s):        JdeB
;===============================================================================oÝ÷ Ù8b±û§rب¬mç§z{b­ér­êeiÇo%zCn·«!#ºÚ"µÍÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÕÙYZÓ[XTÓÊ
BÈØÜ[Û[Ý]HÙYZÈ[XÙÝ[]]][[[Y]ÂÂÈ[Y]ÊN  ÌÍÚQ^HH^H[YH
Y][[^JBÈ    ÌÍÚS[ÛH[Û[YH
Y][[[Û
BÈ ÌÍÚVYXHYX[YH
Y][[YXBÈ]Z[Y[
ÊNÈ][YJÊNÛÝXØÙÜÈH]ÈÙYZÈ[XÙÚ][]BÈÛZ[HH]ÈLH[Ù]ÈTÔHHÛ][H[Y]È[YÂÈÛÛXXØÙXHÙYZÜÝ[YHÙ]ÈTÔHNH[ÙÈY][
Ý[^JHÈÝ[È^]]ÜÊNXBÈP[ÙYYYÈQÝ[È [ÈØËÈPÚ[ÙHØ[Ý[][ÛÙÚXËÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

I suspect the old version is deprecated and no longer support, just left in place to support legacy code.

:)

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 suspect the old version is deprecated and no longer support, just left in place to support legacy code.

:)

...then, I should user _WeekNumberISO and tweak my code based on that function, for _WeekNumber one day may just not be there. Am I wright ?

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

...then, I should user _WeekNumberISO and tweak my code based on that function, for _WeekNumber one day may just not be there. Am I wright ?

That's correct.

:)

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

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