From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110557 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jairo A. del Rio" Newsgroups: gmane.comp.tex.context Subject: Re: Loop? Date: Fri, 12 Feb 2021 14:48:23 -0500 Message-ID: References: <20210212183905.GG6275@zombi.ugr.es> <6aaa806e-5fb0-61b3-03ca-c56287aabd38@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9045615787809403720==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13032"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 12 20:49:05 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAeR7-0003Gr-8k for gctc-ntg-context-518@m.gmane-mx.org; Fri, 12 Feb 2021 20:49:05 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6D83328098D; Fri, 12 Feb 2021 20:48:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sS1-oSUlGubj; Fri, 12 Feb 2021 20:48:38 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BB4AF28098F; Fri, 12 Feb 2021 20:48:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 71094280989 for ; Fri, 12 Feb 2021 20:48:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kPW9l-Z_TU3 for ; Fri, 12 Feb 2021 20:48:36 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.46; helo=mail-wr1-f46.google.com; envelope-from=jairoadelrio6@gmail.com; receiver= Original-Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 0597B280987 for ; Fri, 12 Feb 2021 20:48:35 +0100 (CET) Original-Received: by mail-wr1-f46.google.com with SMTP id v7so513058wrr.12 for ; Fri, 12 Feb 2021 11:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sZ6nvvfvsaP9WsaERApduazx2EgN+kWHVUQlMeWgMOQ=; b=fjcRUzuZ4rFf4OhrBeGZdgyYxaEPCFEwDXw6UYVNbAYHuPy7hPLhyjquHTqZUlHEF7 G7F4ag14OD/bgwL/Qn+bWs5w0ADWwmQ2TW3WRtcBi2XtavyiQOtn2TjsSP0pvl8vdvux jkLVNrX42uh/c8h61XUIyTOmgwm1Yyl6Hze/DkeGSqbf3mFVxdEgC7iWDv/Yo/yyMHYC VKQmHRFI/5w2JbeKgFDgq/Lyfm2+ANFVl+4MvP7Qd3d+iaE9KT2MpUKEC/MJq8H3DuiC iX/WtWyDxiOt2NvU4fwrkvLPKNw/b6Xf5RiJmbq6LIprKdarJuAB5gKbTlcIB2trjg6e Os0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sZ6nvvfvsaP9WsaERApduazx2EgN+kWHVUQlMeWgMOQ=; b=mLaLt5/nEQtbmPBcteNTdYFsNhVz4K8WEqr3LMoZuYnSByFbUNMCINVvojk3vxgtBA UaFbNE+M/wfWvEWHUVf2MjfeeCTO+ytAnGKjMPkXQ1NVhbw4AmiONBcLNkUX0bhklxcL aaiqHKrzufaU7bE6oQvNgPBPGZJpAkqNDvr59Gn2bAF6pJBso+ixi/MpVz6eOuGQYu5o PAm90Xz6qwVKxrtm8MqNFY8UbRP0+0hGCX3IQr+Xm+FHKxcHfTA+fWKuPulrorxUVfu/ wvXt7DWo+p+g5lhXia1U/BnUzACtF4pZFNLa5AUIoIzytv09IJD6xdt/57chKGQprFTI OjYA== X-Gm-Message-State: AOAM532GP47K8yHQLMb1Eg1auuMIWyD5y1kyvlNsvTb5n0XV33E5gATt gTSy2b34CxuM8dMhsAUI1EWgXxXFuqR2q4w11Nk= X-Google-Smtp-Source: ABdhPJy0tdJj17f+11O+IOG2++5yyE9SJHm9MJs7BlFR63XFADo8K6sLlS+aeVOwUdybsMOpt5TbWlGNZ+TFFlVnVGk= X-Received: by 2002:a05:6000:236:: with SMTP id l22mr4994000wrz.349.1613159315688; Fri, 12 Feb 2021 11:48:35 -0800 (PST) In-Reply-To: <6aaa806e-5fb0-61b3-03ca-c56287aabd38@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:110557 Archived-At: --===============9045615787809403720== Content-Type: multipart/alternative; boundary="000000000000fa507a05bb28eb46" --000000000000fa507a05bb28eb46 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=B3: > Jairo A. del Rio schrieb am 12.02.2021 um 19:50: > > Hi, =C3=81ngel. 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=3D\NameEntry] > > \starttexdefinition unexpanded NameEntry #1 > Person Number #1\par > \stoptexdefinition > > \startseparatedlist[namelist] > One > Two > Three > Four > \stopseparatedlist > > \stoptext > > > Wolfgang > --000000000000fa507a05bb28eb46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 fe= b. de 2021 a la(s) 14:25, Wolfgang Schuster (wolfgang.schuster.lists@gmail.com) escribi=C3=B3= :
Jairo A. del R= io schrieb am 12.02.2021 um 19:50:
> Hi, =C3=81ngel. 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 basic= ally
> that way, I think.


You can use the commalist environment:

\starttext

\startprocesscommalist[One,Two,Three,Four]
=C2=A0 =C2=A0 =C2=A0Person Number \currentcommalistitem\par
\stopprocesscommalist

\blank

\defineexpandable\NameList{One,Two,Three,Four}

\startprocesscommacommand[\NameList]
=C2=A0 =C2=A0 =C2=A0Person Number \currentcommalistitem\par
\stopprocesscommacommand

\stoptext


Another way is to use the database module:

\usemodule[database]

\starttext

\defineseparatedlist
=C2=A0 =C2=A0[namelist]
=C2=A0 =C2=A0[command=3D\NameEntry]

\starttexdefinition unexpanded NameEntry #1
=C2=A0 =C2=A0 =C2=A0Person Number #1\par
\stoptexdefinition

\startseparatedlist[namelist]
One
Two
Three
Four
\stopseparatedlist

\stoptext


Wolfgang
--000000000000fa507a05bb28eb46-- --===============9045615787809403720== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============9045615787809403720==--