Based on the great answer by Thev and updated by MaxD I have implemented a \default command for switch. I used ifthen package:
\newboolean{default} \newcommand{\case}{} \newcommand{\default}{} \newenvironment{switch}[1]{% \setboolean{default}{true} \renewcommand{\case}[2]{\ifthenelse{\equal{#1}{##1}}{% \setboolean{default}{false}##2}{}}% \renewcommand{\default}[1]{\ifthenelse{\boolean{default}}{##1}{}} }{}
}{} Then implement it as such: \begin{switch}{\program} \case{2}{\twodayprogram} \case{4}{\fourdayprogram} \default{\first\ \last\ missing program\pagebreak} \end{switch} in case anyone is curious, this was a program for an off-season sports conditioning program and was being looped with datatool, the commands \twodayprogram and \fourdayprogram implement the program for a particular athlete