Week number

  • Follow


Google returned WeekNbr=(Current_Day-Days_Preceding_Year)%7+2
for calculating a week number, but this may return 2 when the
first of january is a thursday.

Anyone got a properly working (SIO) week number routine,
including week number 53?



---
0
Reply ML 9/30/2005 2:22:16 PM

If yo send me your email-address I'll send you my week.cmd...
Walter (pachl at chello.at)

"ML" <spamgate@hotmai1.com> schrieb im Newsbeitrag 
news:Xns96E1A6F173D7751015@194.109.133.242...
>
> Google returned WeekNbr=(Current_Day-Days_Preceding_Year)%7+2
> for calculating a week number, but this may return 2 when the
> first of january is a thursday.
>
> Anyone got a properly working (SIO) week number routine,
> including week number 53?
>
>
>
> --- 


0
Reply Walter 9/30/2005 7:32:20 PM


today I lost my incoming mail -- If you (ML) have sent your address, pls 
send it again!

"ML" <spamgate@hotmai1.com> schrieb im Newsbeitrag 
news:Xns96E1A6F173D7751015@194.109.133.242...
>
> Google returned WeekNbr=(Current_Day-Days_Preceding_Year)%7+2
> for calculating a week number, but this may return 2 when the
> first of january is a thursday.
>
> Anyone got a properly working (SIO) week number routine,
> including week number 53?
>
>
>
> --- 


0
Reply Walter 10/1/2005 11:00:18 AM

 > today I lost my incoming mail -- If you (ML) have sent your address,
 > pls send it again!
 
Thanks for the reply, but this sounds like YetAnotherDateLibrary instead of
just a few lines of REXX. weekno=YetAnotherDateLibrary(date,'WEEKNO') would
be fine for my own use, but libraries are too complicated for the All Girls
User Team. BIF's can be found easily in the manual, but this not.

If you do have a few lines of REXX that have to be requested by e-mail, I
still don't need it anymore. I was told that an event happens every odd
week number, but I just found out that this schedule was introduced this
year and didn't keep week numbers 53 and 1 in mind. Actually weeks have
to be skipped, so a 'Date('B')//14'-like construction will do. Thanks
again, but this killed process bug already solved my problem.



---
0
Reply spamgate 10/2/2005 11:39:06 AM

ML wrote:
> Google returned WeekNbr=(Current_Day-Days_Preceding_Year)%7+2
> for calculating a week number, but this may return 2 when the
> first of january is a thursday.
> 
> Anyone got a properly working (SIO) week number routine,
> including week number 53?

There is a Rexx package called "datergf" which allows exactly for that. In addition it allows for 
simple date arithmetics and/or finding specific dates (e.g. first Monday in September (Labor Monday) 
or last Sunday in the fourth quarter, etc.). Here is a link for it:

<http://hobbes.nmsu.edu/cgi-bin/h-search?key=datergf&pushbutton=Search>

The following are results of interactively running datergf-statements via "rexxtry.rex":

say datergf("20050101", "W")  /* ISO week-number */
53
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "DN") /* dayname in English */
Saturday
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "DI") /* ISO day index, 1=Monday, 7=Sunday */
6
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "WB") /* date week begins (= Monday) */
20041227
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "WE") /* date week ends (=Sunday) */
20050102
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "J") /* Julian date */
2005001
   ........................................... rexxtry.rex on WindowsNT
today="20051002"
   ........................................... rexxtry.rex on WindowsNT
say datergf("20050101", "-S", today) /* difference in days */
-274
   ........................................... rexxtry.rex on WindowsNT

HTH,

---rony
0
Reply rony 10/2/2005 12:08:40 PM

On Sun, 2 Oct 2005 12:08:40 UTC, rony <Rony.Flatscher@wu-wien.ac.at> 
wrote:

The better package might be rxdate21.zip from Hobbes. It does come with 
source, and I would assume could be ported to other platforms.

> 
> ML wrote:
> > Google returned WeekNbr=(Current_Day-Days_Preceding_Year)%7+2
> > for calculating a week number, but this may return 2 when the
> > first of january is a thursday.
> > 
> > Anyone got a properly working (SIO) week number routine,
> > including week number 53?
> 
> There is a Rexx package called "datergf" which allows exactly for that. In addition it allows for 
> simple date arithmetics and/or finding specific dates (e.g. first Monday in September (Labor Monday) 
> or last Sunday in the fourth quarter, etc.). Here is a link for it:
> 
> <http://hobbes.nmsu.edu/cgi-bin/h-search?key=datergf&pushbutton=Search>
> 
> The following are results of interactively running datergf-statements via "rexxtry.rex":
> 
> say datergf("20050101", "W")  /* ISO week-number */
> 53
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "DN") /* dayname in English */
> Saturday
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "DI") /* ISO day index, 1=Monday, 7=Sunday */
> 6
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "WB") /* date week begins (= Monday) */
> 20041227
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "WE") /* date week ends (=Sunday) */
> 20050102
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "J") /* Julian date */
> 2005001
>    ........................................... rexxtry.rex on WindowsNT
> today="20051002"
>    ........................................... rexxtry.rex on WindowsNT
> say datergf("20050101", "-S", today) /* difference in days */
> -274
>    ........................................... rexxtry.rex on WindowsNT
> 
> HTH,
> 
> ---rony


-- 
Chuck McKinnis
mckinnis@sandia.net
Covenant Solutions
http://7cities.net/~mckinnis/
0
Reply Chuck 10/3/2005 11:18:45 PM

Hi Chuck,

This package uses the C API to do its calculations, so porting it should 
be easy. I was going to re-write it myself when I had learned enough C 
on OS/2. This is to try to include the Time functions as well, so that I 
could calculate Days and fractions of days eg. 71234.51 + 2.05.

Would anyone else like to try?

Chuck McKinnis wrote:
> On Sun, 2 Oct 2005 12:08:40 UTC, rony <Rony.Flatscher@wu-wien.ac.at> 
> wrote:
> 
> The better package might be rxdate21.zip from Hobbes. It does come with 
> source, and I would assume could be ported to other platforms.
> 

-- 
Regards,
BruceR
data2docSAFE at URLfastmail.com.au (Please modify to reply)
0
Reply BruceR 10/4/2005 9:03:57 AM

Chuck McKinnis wrote:
> 
> The better package might be rxdate21.zip from Hobbes. It does come with 
> source, and I would assume could be ported to other platforms.

In what respect better (just curious) ?

Regards,

---rony
0
Reply rony 10/4/2005 10:31:05 AM

On Tue, 4 Oct 2005 10:31:05 UTC, rony <Rony.Flatscher@wu-wien.ac.at> 
wrote:

I would say because it is a Rexx function rather than a subroutine and 
has a fairly complete set of parms.

    --------------------------------------------------
    rc = RxDate(<date-string>, <format-specifier>)
    --------------------------------------------------

        The first parameter is either an integer containing the number 
of
        days since 1/1/0001. or a date string in one of these forms:

            m-d    (current year is assumed)
            m-d-y
            y-m-d  (only if y > 12)

                ----------------------------------------------------
                Characters other than '-' can be used as separators
                Dates must be in the range 1/1/100 - 12/31/19999
                ----------------------------------------------------

        If the first parameter is omitted, then the current date will be
        assumed.

        If the second parameter is omitted, than an integer is returned
        containing the number of days between the specified day and
        1/1/0001.  If the date is out of the allowed range, -1 is 
returned.

        Arithmetic functions can be used to manipulate the returned
        values, for example:

            today = rxDate()
            tomorrow = today + 1
            yesterday = today - 1

            days_until_new_years_eve = rxDate('12/31') - today

        If the function is called with a second parameter, then the 
        function returns the date formatted according to the second 
        parameter.  If the date is out of the allowed range, the string
        "Error converting date" is returned.

        The second parameter should contain format-specifiers as used by
        the C strftime() function.  The specifiers relating to dates 
are:

            %a - abbreviated weekday name (Sun)
            %A - full weekday name (Sunday)
            %b - abbreviated month name (Dec)
            %B - full month name (December)
            %d - day of the month (01-31)
            %j - day of the year (001-366)
            %m - month (01-12)
            %U - week of the year, where Sunday is the first day (00-53)
            %w - weekday (0-6) where Sunday is 0
            %W - weekday (0-6) where Monday is 0
            %x - the date formatted according to the current locale
            %y - last two digits of the year (00-99)
            %Y - the year 
            %% - the percent character

> 
> Chuck McKinnis wrote:
> > 
> > The better package might be rxdate21.zip from Hobbes. It does come with 
> > source, and I would assume could be ported to other platforms.
> 
> In what respect better (just curious) ?
> 
> Regards,
> 
> ---rony


-- 
Chuck McKinnis
mckinnis@sandia.net
Covenant Solutions
http://7cities.net/~mckinnis/
0
Reply Chuck 10/4/2005 2:13:40 PM

 > %U - week of the year, where Sunday is the first day
 >      (00-53) %w - weekday (0-6) where Sunday is 0

I knew the (OS/2) package existed and I don't need the week number
anymore, but 00-53 doesn't look like ISO to me. I'ld expect the '00'
week number to be continued from last year, being either 52 or 53.
But I could be wrong here, not knowing the exact ISO definition for
what's week '00' here.



---
0
Reply ML 10/4/2005 3:41:01 PM

ML wrote:

> 00-53 doesn't look like ISO to me. I'ld expect the '00' week number
> to be continued from last year, being either 52 or 53.
> But I could be wrong here, not knowing the exact ISO definition for
> what's week '00' here.

Wikipedia says about ISO-8601:

  �Weeks are given two digits beginning with 01 as the first week
   of the year (see below), up to 52 or 53 being the last week of 
   the year.�

See <http://en.wikipedia.org/wiki/ISO_8601#Week_dates>.

Cheers,

-- 
Klaus Alexander Seistrup
Magnetic Ink, Copenhagen, Denmark
http://magnetic-ink.dk/
0
Reply Klaus 10/4/2005 3:54:34 PM

 >> The better package might be rxdate21.zip from Hobbes.

 > try to include the Time functions as well, so that I could
 > calculate Days and fractions of days eg. 71234.51 + 2.05.

Used in which way? Do you want RxDate() to return '<TODAY> 0:00am'
and have to use PARSE each time you only need the date? What about
8 hours times 3, should that return .99 day or 1.00 day?

Maybe a stand-alone RxTime would be better? If today is 71234, just
add (.51+2.05)%1 to today's number and feed (.51+2.05)//1 to your
RxTime()-function ?



---
0
Reply ML 10/4/2005 3:57:58 PM

The strftime(3) on my box says:

#v+

       %U     The  week  number of the current year as a decimal number, range
              00 to 53, starting with the first Sunday as  the  first  day  of
              week 01. See also %V and %W.

       %V     The  ISO  8601:1988 week number of the current year as a decimal
              number, range 01 to 53, where week 1 is the first week that  has
              at  least  4  days  in  the current year, and with Monday as the
              first day of the week. See also %U and %W. (SU)

       %W     The  week  number of the current year as a decimal number, range
              00 to 53, starting with the first Monday as  the  first  day  of
              week 01.

#v-

(SU == Single Unix Specification.)

Cheers,

-- 
Klaus Alexander Seistrup
Magnetic Ink, Copenhagen, Denmark
http://magnetic-ink.dk/
0
Reply Klaus 10/4/2005 3:59:17 PM

 > Wikipedia says about ISO-8601:
 
 > �Weeks are given two digits beginning with 01 as the first week
 >  of the year (see below), up to 52 or 53 being the last week of 
 >  the year.�

Thanks, this confirms my point of view. I couldn't find a (posted)
REXX function nor subroutine in this ng which covered the first days
of the year properly, but I may have overlooked one. I guess one has
to start with the previous year unless maybe the 1st of january is a 
thursday, otherwise one could end up with stuff like week '00'. The
1st of january can be 52, 53 or 1.



---
0
Reply ML 10/4/2005 4:06:11 PM

> Thanks, this confirms my point of view. I couldn't find a (posted)
> REXX function nor subroutine in this ng which covered the first days
> of the year properly, but I may have overlooked one. I guess one has

datergf
;)

---rony

P.S.: Here's the synopsis of datergf, which is written in classic Rexx and can be invoked via the 
commandline as well:

DATERGF: manipulate sorted dates, time, days and time-fractions

usage as a function in REXX-programs:
          DATERGF(argument)
          DATERGF(argument, flag)
          DATERGF(argument1, flag, argument2)

usage from command-line:
          DATERGF argument
          DATERGF argument, flag
          DATERGF argument1, flag, argument2

          see enclosed Tutorial "RGFSHOW.CMD" and syntax below

syntax:

SDATE ...... sorted date (YYYYMMDD)
JDATE ...... Julian date (YYYYDDD)
DAYS ....... DATERGF-days, if time supplied, time is a decimal fraction
TIME ....... on input 24hour- (military) or 12hour-format allowed,
              output will be allways in 24hour-format (military, computer)
FRACT ...... decimal fraction of time
SECONDS .... second-value for DAYS.FRACT

Argument1:      Flag: Argument2:        Result:

"SDATE[ TIME]"                          DAYS[.FRACT] since 00000101 inclusive
"DAYS[.FRACT]", "S"                     SDATE[ TIME24]
"SDATE[ TIME]", "J"                     JDATE
"JDATE",        "JR"                    SDATE ("Julian Reversed")

"TIME",         "F"                     FRACT
"FRACT",        "FR"                    TIME24 ("Fraction Reversed")

"DAYS[.FRACT]", "SEC"                   SECONDS
"SECONDS",      "SECR"                  DAYS[.FRACT] ("SEConds Reversed")

"SDATE[ TIME]", "-S", "SDATE[ TIME]"    DAYS[.FRACT]
"SDATE[ TIME]", "-",  "DAYS[.FRACT]"    SDATE[ TIME24]
"SDATE[ TIME]", "+",  "DAYS[.FRACT]"    SDATE[ TIME24]

"SDATE[ TIME]", "C"                     SDATE if correct, nothing ('') if false
"SDATE[ TIME]", "L"                     if leap-year, return 1, else 0
"SDATE[ TIME]", "Y"                     check date & return year
"SDATE[ TIME]", "YB"[, DAYS[.FRACT]]    year begin [+/- DAYS[.FRACT]]
"SDATE[ TIME]", "YE"[, DAYS[.FRACT]]    year end [+/- DAYS[.FRACT]]
"SDATE[ TIME]", "HY"                    semester index (1-2)
"SDATE[ TIME]", "HYB"[, DAYS[.FRACT]]   semester begin [+/- DAYS[.FRACT]]
"SDATE[ TIME]", "HYE"[, DAYS[.FRACT]]   semester end [+/- DAYS[.FRACT]]

"SDATE[ TIME]", "M"                     check date & return month
"SDATE[ TIME]", "MN"                    monthname
"SDATE[ TIME]", "MB"[, DAYS[.FRACT]]    month begin [+/- DAYS[.FRACT]]
"SDATE[ TIME]", "ME"[, DAYS[.FRACT]]    month end [+/- DAYS[.FRACT]]

"SDATE[ TIME]", "D"                     check date & return day
"SDATE[ TIME]", "DN"                    dayname
"SDATE[ TIME]", "DI"                    dayindex (1=monday, ..., 7=sunday)

"SDATE[ TIME]", "W"                     week-number
"SDATE[ TIME]", "WB"[, DAYS[.FRACT]]    week begin (Monday) [+/- DAYS.[FRACT]]
"SDATE[ TIME]", "WE"[, DAYS[.FRACT]]    week end (Sunday) [+/- DAYS.[FRACT]]

"SDATE[ TIME]", "Q"                     quarter index (1-4)
"SDATE[ TIME]", "QB"[, DAYS[.FRACT]]    quarter begin [+/- DAYS[.FRACT]]
"SDATE[ TIME]", "QE"[, DAYS[.FRACT]]    quarter end [+/- DAYS[.FRACT]]
0
Reply rony 10/4/2005 4:18:29 PM

 >> I may have overlooked one. I guess one has
 
 > datergf
 > ;)

I didn't overlook that one, although it wasn't posted here. On it's
own, datergf is well known. I actually used one of your ancient
test dates, IIRC 1-1-1976, to prove the others wrong. :-)

You cannot help it, but the reason I didn't use a subroutine nor
a function in the first place is that the All Girl User Team cannot
find it in a manual, and REXX is able to perform the math. A function
is slightly better, since the RxFundAdd() at least refers to some
useful information. Anyway, that's why I preffered an embedded
solution.

As mentioned earlier I don't need it anymore now, but I was hoping
for a stand-alone solution. From the ones mentioned, datergf probably
returns the best results (for one, week '00' with RxDate() appears to
be wrong or using an existing C function wrongly.



---
0
Reply ML 10/4/2005 4:31:07 PM

ML wrote:

> You cannot help it, but the reason I didn't use a subroutine nor
> a function in the first place is that the All Girl User Team cannot
> find it in a manual

Hua????? Either it is built in to Rexx or you will not consider it due to what ever this "All Girl User Team" is?

The Rexx code you write, does it contain no function / procedure labels as they would not be in the user manual either?

It seems to me as if you are running a V8 engine with only four spark plugs... or maybe I missed something and it is not really THAT extreme.

-- 
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Remove the upper case letters NOSPAM to contact me directly.
0
Reply Michael 10/4/2005 4:48:48 PM

 >> You cannot help it, but the reason I didn't use a subroutine nor
 >> a function in the first place is that the All Girl User Team cannot
 >> find it in a manual
 
 > Hua????? Either it is built in to Rexx or you will not consider
 > it due to what ever this "All Girl User Team" is? 

No support. No backup, other than a printed copy of the REXX code
perhaps. So just slightly understandable BIF's only. Date() can
be found by 'your' mother in the hardcopy REXX manual, while
MyDate() requires more knowledge than available and assumed. And
no, there was no need for any additional documentation indeed. I
could provide the C source of a fast number crunching solution,
but I don't think 'your' mother will be pleaed with that source.
Not everbody is a programmer nor a REXXpert, and it's about as
understandable as possible now. The typical 'computer guy' should
be able to understand it, and that's enough for them. And that's
fine with me, just providing a working solution according to all
requirements.



---
0
Reply ML 10/4/2005 5:38:50 PM

"ML" <spamgate@hotmail.com> wrote in message
news:Xns96E5B890E96E151015@194.109.133.242...
|
|  > Wikipedia says about ISO-8601:
|
|  > �Weeks are given two digits beginning with 01 as the first week
|  >  of the year (see below), up to 52 or 53 being the last week of
|  >  the year.�
|
| Thanks, this confirms my point of view. I couldn't find a (posted)
| REXX function nor subroutine in this ng which covered the first days
| of the year properly, but I may have overlooked one. I guess one has
| to start with the previous year unless maybe the 1st of january is a
| thursday, otherwise one could end up with stuff like week '00'. The
| 1st of january can be 52, 53 or 1.
|
|
|
| ---


For me, 1st of January is always week 01.
That is the first week of the year even if that week has only 1 day.


----------

Santos e Silva


0
Reply Santos 10/4/2005 5:59:22 PM

On Tue, 4 Oct 2005 16:18:29 UTC, rony <Rony.Flatscher@wu-wien.ac.at> 
wrote:

Looks pretty complete to me and probably easier than doing a bunch of 
ports.

Any pride of authorship here? <vbg>

Just kidding.

> > Thanks, this confirms my point of view. I couldn't find a (posted)
> > REXX function nor subroutine in this ng which covered the first days
> > of the year properly, but I may have overlooked one. I guess one has
> 
> datergf
> ;)
> 
> ---rony
> 
> P.S.: Here's the synopsis of datergf, which is written in classic Rexx and can be invoked via the 
> commandline as well:
> 
> DATERGF: manipulate sorted dates, time, days and time-fractions
> 
> usage as a function in REXX-programs:
>           DATERGF(argument)
>           DATERGF(argument, flag)
>           DATERGF(argument1, flag, argument2)
> 
> usage from command-line:
>           DATERGF argument
>           DATERGF argument, flag
>           DATERGF argument1, flag, argument2
> 
>           see enclosed Tutorial "RGFSHOW.CMD" and syntax below
> 
> syntax:
> 
> SDATE ...... sorted date (YYYYMMDD)
> JDATE ...... Julian date (YYYYDDD)
> DAYS ....... DATERGF-days, if time supplied, time is a decimal fraction
> TIME ....... on input 24hour- (military) or 12hour-format allowed,
>               output will be allways in 24hour-format (military, computer)
> FRACT ...... decimal fraction of time
> SECONDS .... second-value for DAYS.FRACT
> 
> Argument1:      Flag: Argument2:        Result:
> 
> "SDATE[ TIME]"                          DAYS[.FRACT] since 00000101 inclusive
> "DAYS[.FRACT]", "S"                     SDATE[ TIME24]
> "SDATE[ TIME]", "J"                     JDATE
> "JDATE",        "JR"                    SDATE ("Julian Reversed")
> 
> "TIME",         "F"                     FRACT
> "FRACT",        "FR"                    TIME24 ("Fraction Reversed")
> 
> "DAYS[.FRACT]", "SEC"                   SECONDS
> "SECONDS",      "SECR"                  DAYS[.FRACT] ("SEConds Reversed")
> 
> "SDATE[ TIME]", "-S", "SDATE[ TIME]"    DAYS[.FRACT]
> "SDATE[ TIME]", "-",  "DAYS[.FRACT]"    SDATE[ TIME24]
> "SDATE[ TIME]", "+",  "DAYS[.FRACT]"    SDATE[ TIME24]
> 
> "SDATE[ TIME]", "C"                     SDATE if correct, nothing ('') if false
> "SDATE[ TIME]", "L"                     if leap-year, return 1, else 0
> "SDATE[ TIME]", "Y"                     check date & return year
> "SDATE[ TIME]", "YB"[, DAYS[.FRACT]]    year begin [+/- DAYS[.FRACT]]
> "SDATE[ TIME]", "YE"[, DAYS[.FRACT]]    year end [+/- DAYS[.FRACT]]
> "SDATE[ TIME]", "HY"                    semester index (1-2)
> "SDATE[ TIME]", "HYB"[, DAYS[.FRACT]]   semester begin [+/- DAYS[.FRACT]]
> "SDATE[ TIME]", "HYE"[, DAYS[.FRACT]]   semester end [+/- DAYS[.FRACT]]
> 
> "SDATE[ TIME]", "M"                     check date & return month
> "SDATE[ TIME]", "MN"                    monthname
> "SDATE[ TIME]", "MB"[, DAYS[.FRACT]]    month begin [+/- DAYS[.FRACT]]
> "SDATE[ TIME]", "ME"[, DAYS[.FRACT]]    month end [+/- DAYS[.FRACT]]
> 
> "SDATE[ TIME]", "D"                     check date & return day
> "SDATE[ TIME]", "DN"                    dayname
> "SDATE[ TIME]", "DI"                    dayindex (1=monday, ..., 7=sunday)
> 
> "SDATE[ TIME]", "W"                     week-number
> "SDATE[ TIME]", "WB"[, DAYS[.FRACT]]    week begin (Monday) [+/- DAYS.[FRACT]]
> "SDATE[ TIME]", "WE"[, DAYS[.FRACT]]    week end (Sunday) [+/- DAYS.[FRACT]]
> 
> "SDATE[ TIME]", "Q"                     quarter index (1-4)
> "SDATE[ TIME]", "QB"[, DAYS[.FRACT]]    quarter begin [+/- DAYS[.FRACT]]
> "SDATE[ TIME]", "QE"[, DAYS[.FRACT]]    quarter end [+/- DAYS[.FRACT]]


-- 
Chuck McKinnis
mckinnis@sandia.net
Covenant Solutions
http://7cities.net/~mckinnis/
0
Reply Chuck 10/4/2005 6:24:55 PM

Chuck McKinnis wrote:
> On Tue, 4 Oct 2005 16:18:29 UTC, rony <Rony.Flatscher@wu-wien.ac.at> 
> wrote:
> 
> Looks pretty complete to me and probably easier than doing a bunch of 
> ports.
> 
> Any pride of authorship here? <vbg>
<g>

Actually, later I wrote a Java version of datergf, which even contained formatting (modeled after 
Tobias Thurston's Rexx version). A friend is supposed to create an ooRexx version of the Java version...

---rony
0
Reply rony 10/4/2005 8:06:42 PM

rony wrote:

> A friend is 
> supposed to create an ooRexx version of the Java version...

hhhmmm, since it is "A" and there are at least two of us pondering such an assignment... ;-)

-- 
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Remove the upper case letters NOSPAM to contact me directly.
0
Reply Michael 10/4/2005 9:19:41 PM

 > The Rexx code you write, does it contain no function / procedure labels as t

BTW, one app doesn't represent 'The Rexx code I write'. Personally, I
use functions a lot.

 > It seems to me as if you are running a V8 engine with only four spark plugs
 
I understand why you mention that, but the thought is wrong. C would be a
better choice from a technical point of view, so perhaps I'm actually using
a basic, underpowered V4 to drive a rather heavy vehicle. By using only
original parts, any underqualified mechanic should be able to repair the
V4. In a way that's the point. One may also get the impression that the
users are 'unsupported idiots'. They're not. They just run the best running
business in the whole business segment, and my BIF-app is actually used to
report that suspected, typical problems of competitors don't occur there at
all. Maybe a programmer is interested in solving 'unknown OLE errors', but
another point of view is at least interesting too. Next time you'll probably
all may or will throw non-BIF's in my direction, and I'm waiting for it. :-)



---
0
Reply spamgate 10/4/2005 9:31:07 PM

In a previous episode of comp.lang.rexx, ML was heard to say:
>Anyone got a properly working (SIO) week number routine,
>including week number 53?

You don't need it any more, but it was a good exercise, so...

This seems to work, but the end points are a bit of hassle (there
must be an easier way of doing it).

 parse value date('s') with year +4
 t=(date('b')-date('d'))//7
 w=(date('d')+t)%7 + (t<3)
 
 if w=0 then do
    year=year-1
    ly=year//4=0 & (year//100>0 | year//400=0)
    w=52 + (t=3 | (t=4&ly))
 end
 else if w=53 then do
    ly=year//4=0 & (year//100>0 | year//400=0)
    if \(t=2 | (t=1&ly)) then do
       w=1
       year=year+1
    end
 end
 
 say "Year" year", week" w
 
-- 
---- Ian Collier : imc@comlab.ox.ac.uk : WWW page (including REXX section):
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml

New to this group?  Answers to frequently-asked questions can be had from
http://rexx.hursley.ibm.com/rexx/ .
0
Reply imc 10/5/2005 11:54:12 AM

"Santos e Silva" <santos_e_silva@sapo.pt> schrieb im Newsbeitrag 
news:4342c316$0$9286$a729d347@news.telepac.pt...
> For me, 1st of January is always week 01.
> That is the first week of the year even if that week has only 1 day.
> Santos e Silva

I guess you must be pretty lonesome :-)

afaik week 1 has at least 4 days of the New Year in it (so 1 Jan must not be 
Fri Sat or Sun)

Walter 


0
Reply Walter 10/7/2005 8:04:06 PM

24 Replies
449 Views

(page loaded in 0.277 seconds)

Similiar Articles:


















7/24/2012 9:12:39 PM


Reply: