Oh, I knew about the environment form, but I didn't know about \currentcommalistitem. Useful to avoid to define ad hoc commands :) As always, thank you very much for the lesson. Best regards, Jairo El vie, 12 de feb. de 2021 a la(s) 14:25, Wolfgang Schuster ( wolfgang.schuster.lists@gmail.com) escribió:
Jairo A. del Rio schrieb am 12.02.2021 um 19:50:
Hi, Ángel. Like this?
\def\mylist{Fulano,Mengano,Sutano}
\def\mycommand#1{#1\blank{\red Something here}\blank}
\starttext
\processcommacommand[\mylist]\mycommand
\stoptext
There are better ways to deal with data in ConTeXt, but it's basically that way, I think.
You can use the commalist environment:
\starttext
\startprocesscommalist[One,Two,Three,Four] Person Number \currentcommalistitem\par \stopprocesscommalist
\blank
\defineexpandable\NameList{One,Two,Three,Four}
\startprocesscommacommand[\NameList] Person Number \currentcommalistitem\par \stopprocesscommacommand
\stoptext
Another way is to use the database module:
\usemodule[database]
\starttext
\defineseparatedlist [namelist] [command=\NameEntry]
\starttexdefinition unexpanded NameEntry #1 Person Number #1\par \stoptexdefinition
\startseparatedlist[namelist] One Two Three Four \stopseparatedlist
\stoptext
Wolfgang