Lets say you want lua to calculate a formula for you, for example
x = (a*b)/s
you can do this by using textinputs and let the user state the difrent values, my problem comes when not
all the variables are given a value, lets say
a = 6
b = 4
s = …
then this error occurres
attempt to perform arithmetic on upvalue ‘x’
thats okey with one formula cause it doesnt stop the app or anything, but when you for example want to calculate two formulas, and the first one get this error the second one wan’t calculate even tough you have stated all the variables on the second one.
example code
local a = 6
local b = 4
local s = …
local i = 16
local t = 12
local f = 3
local function calculate()
x = (a*b)/s
y = (i*t)/f
end
i have found some solutions to this but i’m curios in how some of you people would solve it?
thanks Fredrik [import]uid: 104309 topic_id: 35064 reply_id: 335064[/import]