コード例 #1
0
        protected override bool OnRuntimeTick(RTSThread t)
        {
            bool ret = base.OnRuntimeTick(t);

            if (t.isFinished())
            {
                object o = t.getOutput();
                if (o != RTSVoid.VOID)
                {
                    PutLog(Level.info, string.Format("result: {0} {1} ", o == null ? "" : mEngine.getRTSType(o.GetType()).typeName(), o == null ? "null" : o.ToString()));
                }
            }
            return(ret);
        }
コード例 #2
0
        public object ExecuteImmediate(string cmd)
        {
            mCompiler.reset();
            mCompiler.loadSource(cmd);
            while (mCompiler.isCompiling())
            {
                IRTSDefine.Error error = mCompiler.onCompile(mEngine);
                if (error != 0)
                {
                    logError("rts compile error:" + RTSUtil.getEnumDescript(typeof(IRTSDefine.Error), (int)error) + "-" + mCompiler.getCompilingLinker());
                    return(null);
                }
            }
            IRTSLinker root = mCompiler.getRootLinker();

            if (root != null)
            {
                mImmediateT.loadRunner(root.createRunner());
                while (!mImmediateT.isFinished())
                {
                    try
                    {
                        mImmediateT.run(mEngine);
                    }
                    catch (System.Exception ex)
                    {
                        mImmediateT.catchError(IRTSDefine.Error.Runtime_IndexOutOfBounds, ex.ToString());
                        break;
                    }
                }
                return(mImmediateT.getOutput());
            }
            else
            {
                return(null);
            }
        }