[Coco] Julian Date
Walter Zambotti
zambotti at iinet.net.au
Wed May 24 22:39:54 EDT 2017
>Oh, and if someone feels up to it they can try removing the float()s from the MOD and INT >statements and see if it runs correctly in the 6809 version. I'm fairly certain it will, but it would be >nice to know. I don't have a 6809 version of NOS9 or Basic09 to test with.
You don't need a 6809 or the 6809 version of Nitros09.
You just need the 6809 version of Basic09
How I tested:
VCC 6309 + NOS09 Lvl2 6309 + Basic09_6309 (MOD didn't work)
and
VCC 6309 + NOS09 Lvl2 6309 + Basic09_6809 (MOD did work)
In other words the 6809 version of Basic09 will run in the 6309 environment.
You can tell which version of basic09 you have by reading the opening banner when you start it. It explicitly states the version.
Walter
-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Wayne Campbell
Sent: Thursday, 25 May 2017 10:31 AM
To: CoCoList <coco at maltedmedia.com>
Subject: Re: [Coco] Julian Date
Oh, and if someone feels up to it they can try removing the float()s from the MOD and INT statements and see if it runs correctly in the 6809 version. I'm fairly certain it will, but it would be nice to know. I don't have a 6809 version of NOS9 or Basic09 to test with.
On May 24, 2017 7:26 PM, "Wayne Campbell" <asa.rand at gmail.com> wrote:
> 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
>>
>
--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
More information about the Coco
mailing list