Am 03.06.2013 um 23:47 schrieb Jaroslav Hajtmar
Hello ConTeXist. Obviously I have a problem with expansion. My question is: How can I place the elements of the list into macros for later use? Basically, my point is that I want assign individual values into macros within the cycle of and those subsequently used in a buffer to creating my own report. Perhaps is can be understood what I want from my minimal example.
I suggest to use a different method to store and load the data. The first method is to use the database module (you can also use a external file for the data), the other method is the \setvariables command where you can use keys for the entries. Method 1: \usemodule[database] \define[5]\TestCommand {\starttabulate \NC FIRSTNAME \EQ #1 \NC\NR \NC SURNAME \EQ #2 \NC\NR \NC CITY \EQ #3 \NC\NR \NC STREET \EQ #4 \NC\NR \NC POSTCODE \EQ #5 \NC\NR \stoptabulate \page} \defineseparatedlist[test][command=\TestCommand] \starttext \starttest John, Smith, Prague, Václavské náměstí 20, 11500 Peter, Paul, Brno, Nad struhou 232/12, 234 20 Annie, Walter, Ostrava, Pod lipami 7, 321 54 \stoptest \stoptext Method 2: \startsetups[test] \starttabulate \NC FIRSTNAME \EQ \getvariable{test}{firstname} \NC\NR \NC SURNAME \EQ \getvariable{test}{surname} \NC\NR \NC CITY \EQ \getvariable{test}{city} \NC\NR \NC STREET \EQ \getvariable{test}{street} \NC\NR \NC POSTCODE \EQ \getvariable{test}{postcode} \NC\NR \stoptabulate \page \stopsetups \setvariable{test}{set}{\setups{test}} \starttext \setvariables [test] [firstname=John, surname=Smith, city=Prague, street=Václavské náměstí 20, postcode=11500] \setvariables [test] [firstname=Peter, surname=Paul, city=Brno, street=Nad struhou 232/12, postcode=234 20] \setvariables [test] [firstname=Annie, surname=Walter, city=Ostrava, street=Pod lipami 7, postcode=321 54] \stoptext Wolfgang