views:

80

answers:

1

My googling didn't come up with how to do a switch statement in an algorithm using the algorithm and algorithmic packages, but I'm assuming you can. Most guides just didn't mention it either way.

\begin{algorithm}
\caption{send(...) method}
\begin{algorithmic}
\IF{dest equals..}
%\SWITCH{nature}
\STATE cast data...
\STATE extract data...
\STATE copy...
%\ENDSWITCH
\ELSE
\STATE match dest....
%\SWITCH{nature}
\STATE cast data...
\STATE extract data...
\STATE send...
%\ENDSWITCH
\ENDIF
\end{algorithmic}
\end{algorithm}

Thanks!

+1  A: 

If you have a look at the official documentation from CTAN on the algorithm package you will notice, that there is no default SWITCH-CASE-statement. I assume that to be the reason, why it is left out in so many documentations ;)

froeschli