I'm trying to create a package for drawing simple sequence diagrams using PGF/TikZ. Here is the basic idea I'm stuck at (not the whole idea to make it short):
Let's say we have 1 environment (say myseqdiag) & 1 command (say createobject) in this package.
The user would use these as follows:
\begin{myseqdiag}
\createobject{my name is A}
\createobject{my name is B}
%<here, other calls to createobject>
\end{myseqdiag}
Calling the command createobject causes a counter objcounter to be incremented, and would store #1 (hopefully) in a variable called obja (if there is such thing as "variable" in TeX/LaTeX).
At the environment end, the code should use the final count and use the stored "variables" ("my name is A", "my name is B"....) in drawing the objects (lifelines).
The problem is that I'm not able to store these parameters.
I tried
\def\obj\alph{objcounter}{#1}
inside the code of createobject, hoping that it would define obja, objb, ..., but it's not working.
I also tried other variations that did not work.
I'm newbie to LaTeX, and I'm missing the concept of variables & arrays as in programming languages. So is there a solution to my problem?
Thanks in advance for any help.

\csname ...\endcsname. In your case,\expandafter\def\csname obj\alph{objcounter}\endcsname{#1}. – Bruno Le Floch Apr 28 '11 at 18:20