\rhead{\bf MC\_AgentAddTask()}
\noindent
\vspace{5pt}
\rule{6.5in}{0.015in}
\noindent
\phantomsection
{\LARGE \bf MC\_AgentAddTask()\index{MC\_AgentAddTask()}}\\
\addcontentsline{toc}{section}{MC\_AgentAddTask()}

\noindent
{\bf Synopsis}\\
{\bf \#include $<$libmc.h$>$}\\
{\bf int MC\_AgentAddTask}({\bf MCAgent\_t} $agent$, 
                                  {\bf const char*} $code$,
                                  {\bf const char*} $return\_var\_name$,
                                  {\bf const char*} $server$,
                                  {\bf int} $persistent$
																	);\\

\noindent
{\bf Purpose}\\
This function is used to append a task onto an existing agent.\\

\noindent
{\bf Return Value}\\
The function returns 0 on success or a non-zero error code on failure.\\

\noindent
{\bf Parameters}
\vspace{-0.1in}
\begin{description}
\item
\begin{tabular}{p{30 mm}p{125 mm}} 
$agent$ & A fully initialized agent handle.\\
$code$ & The agent C/C++ code.\\
$return\_var\_name$ & (optional) The name of the agent's return variable.\\
$server$ & The name of the destination server to send the agent.\\
$persistent$ & Whether or not the created agent should be persistent.\\
\end{tabular}
\end{description}

\noindent
{\bf Description}\\
This function is used to append a task onto an agent's task list. Multi-task
agent may be created by using this function in conjunction with the
\texttt{MC\_ComposeAgent*} functions.

\noindent
{\bf Example}\\
\noindent
{\footnotesize\verbatiminput{../demos/composing_agents/multi_task_example/client.c}}

\noindent
{\bf See Also}\\
\texttt{MC\_AgentAddTaskFromFile()}

%\CPlot::\DataThreeD(), \CPlot::\DataFile(), \CPlot::\Plotting(), \plotxy().\\
