getLastResult() public method

public getLastResult ( ) : object
return object
        public object resultFunction(cReportFormula formula)
        {
            String code = "";
            object[] vResult = null;

            m_objGlobals.setMode(eReportCompilerMode.C_RESULT);
            m_ctrlName = formula.getControlName();

            vResult = new object[formula.getFormulasInt().count()];

            cReportFormulaInt fint = null;

            for (int _i = 0; _i < formula.getFormulasInt().count(); _i++)
            {
                fint = formula.getFormulasInt().item(_i);
                vResult[_i] = pResultFunctionInt(fint);
            }

            // we check if the code has scripting or is only 
            // calls to internal functions
            //
            code = formula.getTextC().Replace(C_KEYFUNCINT, "");
            code = code.Replace(" ", "");

            // if after removing calls to internal functions and spaces
            // there is only a number we don't have scripting
            //
            if (G.isNumeric(code))
            {
                if (vResult.Length > 0)
                {
                    formula.setLastResult(vResult[0]);
                    formula.setHaveToEval(false);
                    return formula.getLastResult();
                }
                // the function can be only a constant (it is used in Cairo navigation)
                //
                else
                {
                    return code;
                }
            }
            else
            {
                code = formula.getTextC();
                var parameters = "";

                for (int i = 0; i < vResult.Length; i++)
                {
                    // if one argument is null it means we don't have a row for this formula
                    // so we don't need to compile the code
                    //
                    if (vResult[i] == null) 
                    { 
                        return null; 
                    }

                    /* TODO: remove me
                    code = code.Replace(C_KEYFUNCINT + cReportGlobals.format(i + 1, "000"), 
                                            getNumericVal(vResult[i].ToString()));
                     * */

                    var parameter = "p__" + i + "__";
                    parameters += parameter + ",";
                    code = code.Replace(C_KEYFUNCINT + cReportGlobals.format(i + 1, "000"), parameter);

                    var paramValue = m_objGlobals.getVar(parameter);
                    if (paramValue == null) {
                        paramValue = m_objGlobals.addVar(parameter);
                    }
                    paramValue.setValue(vResult[i]);
                }

                if (parameters.Length > 0)
                {
                    parameters = parameters.Substring(0, parameters.Length - 1);
                    code = insertParametersIntoFunction(code, parameters);
                }

                formula.setLastResult(pExecScriptCode(code, formula));
                formula.setHaveToEval(false);
                return formula.getLastResult();
            }
        }