if (XCALC_PREVIOUSKEYTYPE=="none" or XCALC_PREVIOUSKEYTYPE=="num" or XCALC_PREVIOUSKEYTYPE=="state") then |
if (key == "/" or key == "*" or key == "-" or key == "-" or key == "+" or key == "^") then |
|
if (XCALC_PREVIOUSOP~="") then |
if (XCALC_PREVIOUSOP~="" and XCALC_PREVIOUSOP ~= "=") then |
temp = xcalc_parse(XCALC_RUNNINGTOTAL .. XCALC_PREVIOUSOP .. currText); |
currText = xcalc_xcalculate(temp); |
end |
XCALC_RUNNINGTOTAL = currText; |
XCALC_PREVIOUSOP = key; |
elseif (key == "=") then |
if (XCALC_PREVIOUSOP~="=" and XCALC_PREVIOUSOP~="") then |
if XCALC_PREVIOUSOP ~= "=" and XCALC_PREVIOUSOP ~= "" then |
temp = xcalc_parse(XCALC_RUNNINGTOTAL .. XCALC_PREVIOUSOP .. currText); |
currText = xcalc_xcalculate(temp); |
XCALC_RUNNINGTOTAL = currText; |