Handler or function

Liam Lambert liamlambert at mac.com
Sun Aug 6 14:45:23 EDT 2006


Sorry Typo
Should have said
Hi all I have am using this handler to calculate different prices
for children adults and others
The aPrice cPrice and the oPrice are different prices selected from a
fld with different prices in it
the handler works fine my question is should I do  this with a function
or is there a better way to do this


on fCal
    set the numberFormat to "#0.00" -- dollar format
    put field "aPrice" into theaPrice -- the selected adult price
    Put field "cPrice" into thecPrice -- the selected child price
    put fld "oPrice" into theoPrice ---other selected price
    put field "child" into theChildNumber --the number of children
    put field "adult" into theAdultNumber --the number of adults
    put fld "other" into theOtherNumber ---the number of other

    put (theChildNumber * thecPrice) into field "Childprice"-- * the
number of children by the price
    put (theAdultNumber * theaPrice) into field "Adultprice"-- * the
number of Adults by the price
    put (theOtherNumber * theoPrice) into fld "Otherprice"

    put field "Childprice" into theChildprice
    put field "Adultprice" into theAdultprice
    put fld "Otherprice" into theOtherPrice
    put theAdultprice + theChildprice + theotherPrice into field "Total"
end fCal

Thank's Liam


IRELAND
liamlambert at mac.com






More information about the use-livecode mailing list