Subj : Trying
To   : All
From : Sean Dennis
Date : Sat Jun 04 2005 07:20 pm

Hello, All.

I'm trying to write a biorhythm door for a friend, but am stymied at one point
Here's the code (rather sloppy right now):

 dClrScr;
 Write('Your birthyear [XXXX]: ');
 dReadI(BirthYear);
 Work := (2005-BirthYear)*365;
 DCrlf;
 dWriteLn('You are ' + itos(Work) +' days old.');
 dCrLf;
 Temp := Sin(2*(Work/23)*Pi)*100;
 dWriteLn('Your physical percentage is '+Temp+'%.');

Temp is declared Real.  I know I have to convert Temp into an integer value to
write it out (well, longint) using the doorkit, but when I use Round or Trunc,
I get either zero or a negative value.

Work is the number of days you've been around (done by a rather loose formula
of 2005-Birthyear*365.25).

Unfortunately, math is not my strong spot and I know that there's a simple
solution to this somewhere.  Can anyone help?

Later,
Sean

// [email protected] | http://outpostbbs.net | ICQ: 19965647

--- GoldED+/W32 1.1.5-21011
* Origin: Outpost BBS - outpostbbs.net (1:18/200)