EDD calc
Stephen Messimer
steve at messimercomputing.com
Wed Jul 16 08:36:00 EDT 2003
Ubaldo.
This solution requires two fields and one button. No persistent
storage container is required to hold the gestation info other than the
button script. You could store this information in a field or custom
prop but that really isn't necessary.
Try this ...
Create a field "LMP" for the user to type the LMP into.
Create a button "EDD"
Now go to the button's script and type"
on mouseUp
-- convert 280 days to seconds (60*60*24*280 = 24192000) for calculation
put 24192000 into gest
put fld "LMP" into lmpCalc
convert lmpCalc to seconds
add lmpCalc to gest
-- now convert seconds back to the date
convert gest to date
into fld "EDDFld"
end mouseUp
now create a fld named "EEDFld" to place the calculated EED into.
Hope this helps.
By the way I married an Italian Woman. So I feel sort of like Familia.
Ciao
Steve
Stephen R. Messimer, PA
208 1st Ave. South
Escanaba, MI 49829
www.messimercomputing.com
On Tuesday, July 15, 2003, at 05:20 PM,
use-revolution-request at lists.runrev.com wrote:
> Sorry for another basic question to the list but:
> I would like to have a field as a container for a date, then a button
> that
> performs a calculation on that date and puts the result in another
> field.
> For instance, for a given LMP (last menstrual period) I need to
> calculate an
> EDD (estimated date of delivery) that is simply LMP+280 (and this is
> what I
> do in Excel or FileMaker).
> Pleeeease, assume an IQ<=40; some lines to cut and paste between "on
> mouseup" and "end mouseup" would be very very appreciated.
> Thank you very much
> Ciao
> Ubaldo
>
More information about the use-livecode
mailing list