Common Operations

MCAgent

Examples of commonly used MCAgent operations: Find an agent by name (assumes an MCAgency named Agency):
 MCAgent agent;
 try
 {
 agent = Agency.FindAgentByName("persistent1");
 }
 catch (Exception e)
 {
 Console.WriteLine("Exception: " + e.Message);
 }

Terminate an agent

 int temp;
 try
 {
 temp = agent.TerminateAgent();
 Console.WriteLine("TerminateAgent() returned " + 
 temp.ToString() + ".");
 }
 catch (Exception e)
 {
 Console.WriteLine("Exception: " + e.Message);
 }

Print information about an agent:

 Console.WriteLine(agent.ToString());
 Console.WriteLine(agent.GetAgentXMLString());
 Console.WriteLine(agent.RetrieveAgentCode());

Generated on Tue Oct 28 17:03:24 2008 for Mobile-C by doxygen 1.5.5

AltStyle によって変換されたページ (->オリジナル) /