I build a list by a macro to store some values. I wonder if there is method to get value by its index number from the list. The following code shows my intention.
Code example:
\documentclass{article}
\def\mylist{a,bc,efg,hijk,lmn,} %define a macro to stroe a series of values.
\newcommand\test[2]{...}% #1 for index number; #2 is a list.
\test{2}{\mylist} % "bc" expected.
\test{5}{\mylist} % "lmn" expected.
\test{6}{\mylist} % get nothing.
\end{document}