[Coco] Julian Date

Wayne Campbell asa.rand at gmail.com
Wed May 24 22:26:14 EDT 2017


The problem has been solved, and there are at least two broken functions in
B09. The integer versions of INT and MOD do not return the correct results.
I forced the use of the real (float) versions and the results are now
correct.

I also had to make a correction to the weekday name code. With the weekday
names ordered from Monday through Sunday, the weekday name chosen was one
off (Monday instead of Tuesday for example). Adding 1 to the calculation
corrected that. I could have ordered the array from Tuesday through Monday,
but I decided adding 1 was easier.

I will upload the corrected code tomorrow if I can, otherwise as soon as
possible.


On May 24, 2017 3:33 PM, "Christopher R. Hawks" <chawks at dls.net> wrote:

> On Wed, 24 May 2017 14:28:04 -0700
> Wayne Campbell <asa.rand at gmail.com> wrote:
>
> > The functions provided by Luis are not Basic09. B09 does not support
> > function structures like this, and MOD in B09 is a ML function whose
> > syntax is MOD(arg1,arg2), not arg1 MOD arg2.
> >
> >
>
>   And while you _can_ set the values of parameters passed in
> (dd = dias, mm = FIX(dd / 61) * 2 + 1, etc) NOT recommended
> I'm pretty sure you can't set the function name to something
> (FechaJulDMA = dias)
>
> > On May 24, 2017 2:22 PM, "Gregory Law" <glaw at live.com> wrote:
> >
> > This is Basic09 on OS-9/NitrOS-9.
> >
> > On 5/24/2017 5:18:54 PM, "Wayne Campbell" <asa.rand at gmail.com> wrote:
> >
> > >I find these two functions interesting. What language is it?
> > >
> > >It looks like BASIC, but I've never seen a function in basic written
> > >this
> > >way before.
> > >
> > >
> > >On May 23, 2017 7:37 PM, "Luis Fernández" <luis46coco at hotmail.com>
> > >wrote:
> > >
> > >>  OR
> > >>
> > >>
> > >>  FUNCTION FechaJulDMA (tjul, dd, mm, aa)
> > >>  T = tjul + 62
> > >>  t2 = FIX(T / 1461) * 4 + 1700
> > >>  t1 = T MOD 1461
> > >>  IF t1 > 365 THEN
> > >>  t1 = t1 - 1
> > >>  oa = FIX(t1 / 365)
> > >>  t1 = t1 MOD 365
> > >>  END IF
> > >>  aa = t2 + oa
> > >>  dias = t1 + 1
> > >>  dd = dias
> > >>  swb = 1 - SGN(oa)
> > >>  IF dd > 212 + swb THEN dd = dd + 30
> > >>  IF dd > 59 + swb THEN dd = dd + 2 - swb
> > >>  mm = FIX(dd / 61) * 2 + 1
> > >>  dd = dd MOD 61
> > >>  IF dd > 31 THEN mm = mm + 1: dd = dd - 31
> > >>  IF mm > 7 THEN mm = mm - 1
> > >>  FechaJulDMA = dias
> > >>  END FUNCTION
> > >>
> >
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> >
>
>
>
>
> Christopher R. Hawks
> HAWKSoft
> --
> I dipped into the future far as human eye could see,
> Saw the vision of the world and all the wonder that would be.
>                 --Alfred Lord Tennyson
> ----------------------------------------
>        \   ^__^
>         \  (oo)\_______
>            (__)\       )\/\
>                ||----w |
>                ||     ||
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list