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);
	}
示例#2
0
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);
    }
}