Functions?
Posted: Sat Jun 18, 2011 9:43 am
Hi.. This is my first post. I am new to Livecode!...
I am sorry if this question is obvious but I have searched the help file and forum and cannot find an answer that relates to my question. Please can someone help me?
I have three fields: Field1 Field2 Result I am using the following code that is executed when the user leaves each field
My full application will have a lot more going on but I need to work out the principle first.... I need to "call" this code from each field so that when the code is changed I don't have to go to every location and edit it. I understand that if you don't enter script into the field the message is passed up to the stack... this is OK.. but what if I want to have different maths calculations stored and then executed from different fields. Again the maths will be involved so I do not want to have to edit in each object only in one place.
I hope you can understand what I am trying to do... my finished application will have the requirement to perform a number of maths calculations in script and I only want to edit this script if it has an error in one place.
Any help appreciated....
Thanks
I am sorry if this question is obvious but I have searched the help file and forum and cannot find an answer that relates to my question. Please can someone help me?
I have three fields: Field1 Field2 Result I am using the following code that is executed when the user leaves each field
Code: Select all
on closefield
if the text of fld "Field1" is a number or the text of fld "Field2" is a number then
put fld "Field1" + fld "Field2" into fld "Result"
End if
end closefield
I hope you can understand what I am trying to do... my finished application will have the requirement to perform a number of maths calculations in script and I only want to edit this script if it has an error in one place.
Any help appreciated....
Thanks