\setNames{ABC}{1}{10} should result in the following commands being defined
\ABCi as ABC--1
\ABCii as ABC--2 and so on through
\ABCx as ABC--10
Code: Select all
\documentclass[12pt]{article}
\usepackage{trace}
\makeatletter
\gdef\make@neName#1#2{\expandafter\newcommand\csname#1\romannumeral#2\endcsname{#1--#2}}}
\gdef\setNames#1#2#3{
\newcount\n
\n=#2
\loop\ifnum\n<#3
\expandafter\make@neName{#1}{\number\n}
\advance\n by 1
\repeat
}
\makeatother
\traceon
\setNames{ABC}{1}{20}
\traceoff
\setNames{ABC}{1}{20}
\begin{document}
This is a test of the well name macro that should set \\
\ABCii,
\ABCiii,
\ABCiv,
\ABCv,
\ABCvi,
\ABCvii,
\ABCviii,
\ABCix,
\ABCxi,
\ABCxii,
\ABCxiii,
\ABCxvi,
\ABCxvi,
\ABCxvii,
\ABCxviii,
\ABCxix,
and ABCxx.
\end{document}
\ABCi though \ABCx are all defined as ABC--\number\n which expands to whatever \n is at the time. I will work if I call \make@neName directly (i.e \makeOneName{ABC}{10} gives the correct \ABCx as ABC--10.
Thanks for the help in advance
Jeff