Adding numbers

Devin Asay devin_asay at byu.edu
Tue Dec 11 11:33:01 EST 2001


At 10:57 AM -0500 12/11/01, Mike McKenzie wrote:
>My appologizes to the programers here, but as I am not, my questions will be
>of the "dumb" variety. I wish I had a printed manual so I could try to find
>the answers off-line. Anyway here's my question:
>
>How do I perform a math function (like add, subtract, etc.) on the number
>input into a text field and then display the result in another textfield?
>(Just your basic spreadsheet)

put fld "foo" + 15 into fld "bar"

  -- OR

put fld "foo" + fld "bar" into fld "foobar"

-- OR

add 15 to fld "foo"  -- result will appear in fld "foo"

>Also how do I restrict the input to only numbers?
>

if not (inputVariable is a number) then ...

Devin
-- 
Devin Asay
Humanities Research Center
Brigham Young University



More information about the use-livecode mailing list