Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

It wants to be soluted.. [and it is!]

edited December 2015 in Questions Posts: 815

I wrote 4 . 5 - 3 . 5 = ERROR!!
Why it is wrong? I thought it is good!

if key == "dot" then
        if isNumber1 == true then
            -- true
            txt.value = txt.value .. "."
            number = number .. "."
        else
            -- false
            if operation ~= nil then
                txt.value = txt.value .. "."
                number = txt.value .. "."
            else --if nil
                alert("Operation is on nil! You can't use the comma!", "Error")
            end
        end
        drawing = false
    end
end

Comments

  • Posts: 815

    It says arithmetic on a nil string value

  • dave1707dave1707 Mod
    Posts: 7,604

    It's exactly what it says. You have a string variable that's nil and you're trying to do arithmetic with it. You're not moving anything to one of the variables you're using.

  • Posts: 815

    But how to do it then, I created locals called isComma. True/F, how to work with it. My numbers are string created number .. key so there is a value number .. ".", - this whit the dot does not exist. Isn't there any way to solute the comma? :(

  • Posts: 815

    Soluted! I wrote number = txt.value and txt.value is a string. Soluted!

Sign In or Register to comment.