Return information from #Stata macros such as the number of elements or the n-th element https://bit.ly/3TtzM8R
Information about Stata macros: number of elements and order within locals and globals – StataTex Blog