bool IDockScreenDisplay::EvalString (const CString &sString, bool bPlain, ECodeChainEvents iEvent, CString *retsResult) // EvalString // // Evaluates the given string. { CCodeChainCtx Ctx; Ctx.SetEvent(iEvent); Ctx.SetScreen(m_pDockScreen); Ctx.SaveAndDefineSourceVar(m_pLocation); Ctx.SaveAndDefineDataVar(m_pData); return Ctx.RunEvalString(sString, bPlain, retsResult); }
void CMission::FireCustomEvent (const CString &sEvent) // FireCustomEvent // // Fires a custom timed event { SEventHandlerDesc Event; if (FindEventHandler(sEvent, &Event)) { CCodeChainCtx Ctx; Ctx.SetEvent(eventDoEvent); Ctx.SaveAndDefineSourceVar(this); ICCItem *pResult = Ctx.Run(Event); if (pResult->IsError()) ReportEventError(sEvent, pResult); Ctx.Discard(pResult); } }