ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jaroslav Hajtmar <hajtmar@gyza.cz>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: \processcommalist and load values into macros.
Date: Mon, 03 Jun 2013 23:47:07 +0200	[thread overview]
Message-ID: <51AD0EDB.1010609@gyza.cz> (raw)

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.

Thanx
Jaroslav Hajtmar

Minimal example:


\let\filename\null
\let\firstname\null
\let\surname\null
\let\city\null
\let\street\null
\let\postcode\null


\def\dosomething#1{#1\par}

\def\loadlistdatatomacros#1,#2,#3,#4,#5 {
\global\def\firstname{#1}
\global\def\surname{#2}
\global\def\town{#3}
\global\def\street{#4}
\global\def\postcode{#5}
}




\startbuffer[mypostbuffer]
\dosomething

% \loadlistdatatomacros
FIRSTNAME: \firstname\par
SURNAME: \surname\par
CITY \city\par
STREET \street\par
POSTCODE \postcode\par
\page
\stopbuffer


\starttext


\processcommalist[
{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 },
]{\getbuffer[mypostbuffer]}


\stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2013-06-03 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 21:47 Jaroslav Hajtmar [this message]
2013-06-04 17:34 ` Wolfgang Schuster
2013-06-04 18:26   ` Jaroslav Hajtmar
2013-06-04 18:40     ` Wolfgang Schuster
2013-06-04 21:23       ` Jaroslav Hajtmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51AD0EDB.1010609@gyza.cz \
    --to=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).