[Gambas-user] searching sunset/sunrise function

Benoit Minisini gambas at ...1...
Thu May 22 11:39:40 CEST 2008


On jeudi 22 mai 2008, Ron wrote:
> > If you have the snippets, I'm interested in converting to gambas
> >
> >
> > ---------- Original Message -----------
> > From: Ron <ron at ...1740...>
> > To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> > Sent: Mon, 19 May 2008 12:01:33 +0200
> > Subject: [Gambas-user] searching sunset/sunrise function
> >
> >> Hi,
> >>
> >> Does anybody know if  a sunset/sunrise calculator functions/snippet in
> >> gambas exists by any chance?
> >>
> >> I have found some vb and vbscript snippets, but porting them is not
> >> easy, or they give wrong results.
> >>
> >> Regards,
> >> Ron.
>
> Nando,
>
> I have attached the module made so far.
>
> CalcSunTimes() is returning fair results, as far as I an see, but
> haven't checked it much, you're welcome to make it better. (see link
> above routine)
> CalcMoonPhase() is the beginning of converting code (from link in
> module), but the phase it returns is false, puzzle as to why, maybe
> usage of wrong datatype, or round()s? would be nice to get this fixed.
>
> Alas I'm no Gambas nor Math/Astronomy wizard.
>
> Regards,
> Ron.

Math.Floor() in Javascript must be replaced by Int(), not Round(). Maybe it is 
the source of the problem.

Regards,

-- 
Benoit Minisini




More information about the User mailing list