From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/99966 Path: news.gmane.org!.POSTED!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: \setvariables and database module Date: Tue, 30 Jan 2018 16:53:33 +0100 Message-ID: <4010CA62-43ED-4745-A0A5-0A7441D66F0A@gmail.com> References: <5B4C64AF-6E7E-4178-840E-C3BCDF0D1529@gmail.com> <5A708713.4010503@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.9\)) Content-Type: multipart/mixed; boundary="===============5886176240702938453==" X-Trace: blaine.gmane.org 1517327577 25522 195.159.176.226 (30 Jan 2018 15:52:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Jan 2018 15:52:57 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 30 16:52:52 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egYD3-0005Lq-1y for gctc-ntg-context-518@m.gmane.org; Tue, 30 Jan 2018 16:52:33 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BF92B425242; Tue, 30 Jan 2018 16:54:26 +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 9E-TrCRCoasB; Tue, 30 Jan 2018 16:54:10 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 25C744251B9; Tue, 30 Jan 2018 16:54:06 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3F9DF4251B9 for ; Tue, 30 Jan 2018 16:54:05 +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 g84o8q8CKVrG for ; Tue, 30 Jan 2018 16:53:45 +0100 (CET) Original-Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 9DBD44251B0 for ; Tue, 30 Jan 2018 16:53:35 +0100 (CET) Original-Received: by mail-wm0-f50.google.com with SMTP id v123so2093644wmd.5 for ; Tue, 30 Jan 2018 07:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=6ml8PwhNrvFa/KOhrgEnzqXJsarp7DMlxV8sYHfiZxc=; b=cDwBodOY6cxPPnPLef/pAjxLdA+39zWvBGQ50R9Fz6JQcrs+ihVHLd5PJbWEEjUfdy 5CYjPoCr6IWcjozRe1G+XqHqp80o8J8TzrphMq6fzvooY97XaF370fgdiHK9YIKZg7Uw D0hAq5qETuUvBZTX7brGiPVMU3Dtbw08HVfTchY6wnyvtzC+N4+hkd9dcGn9MJgof6ah Y3jLn9vtk+iyoNCuSZs7dLt9RRxd3jvlxYFXn610oxHT2TCsZ5rtzYj4XxJqtgkfhMk+ rvo5meHlaVyRJmrHzZ2F/IxxrRJqtUPeqMuqKqlCaWXZy+BTYJeTcdfhJD3Md5YZZjq0 xTAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=6ml8PwhNrvFa/KOhrgEnzqXJsarp7DMlxV8sYHfiZxc=; b=jmMAohxqFfe/ZlEQqc2zIU73/FQMLmXxKTMbhAD3PPyDMmdZWT40I3C9wUdo+mhWu+ Lj6nT/4WH4jNTEtvrSc+Y17qWYEltPyNelWJEwtg3njwRCc5NxVHcRFgCkbp6uyCygxQ WFabQUI2hDBL2OvEJ3SjLogpWGGUKhnoU22BhgaQ1t37n8BzCsS02O1iExGHE7PBA7yK tqPoVf4XNBSeONJgsvqc0PUbDRqvMTEntmOTiicuytkDl0ReHIRvYTz76sPqIGwJLeQE QfsU8ztPp3VshzivOfec+isrMmG0yCshcVFG4wy0/LaT3Xf3VmHMgCTb8K7FK1mi7B2p S0OA== X-Gm-Message-State: AKwxyteh8JLf9z2s48qXmB6mrjeZtFhkFfYwxOK31cGYF8kr286PKOXc pdysddGLV1XiVGFuo3poyIJE90+w X-Google-Smtp-Source: AH8x224jpsdsuo/fAyArfWimYaHRL0nM7fnzGDiUP+6wkb12VPKO0SsJC8IalNMWsniZprYs18nw4w== X-Received: by 10.28.208.76 with SMTP id h73mr22105091wmg.35.1517327615150; Tue, 30 Jan 2018 07:53:35 -0800 (PST) Original-Received: from ?IPv6:2001:660:300f:5:3901:3cfe:1d1e:1cd0? ([2001:660:300f:5:3901:3cfe:1d1e:1cd0]) by smtp.gmail.com with ESMTPSA id y55sm26860278wry.87.2018.01.30.07.53.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 07:53:34 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3445.6.9) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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.org gmane.comp.tex.context:99966 Archived-At: --===============5886176240702938453== Content-Type: multipart/alternative; boundary="Apple-Mail=_CD18B10F-1671-43D7-90F8-292E67C5C8F1" --Apple-Mail=_CD18B10F-1671-43D7-90F8-292E67C5C8F1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi again Wolfgang, I think I understood what is going wrong with my example after your = hint: I have to remove all spaces around the separator and remove also = the braces around each entry. That is the following works fine: \startseplisttalk Hacker;Up to date hacking;hacker.jpg Hacker;Up to date hacking;hacker.jpg \stopseplisttalk while the following does not (as far as the filename is concerned): \startseplisttalk {Hacker};{Up to date hacking};{hacker.jpg} Hacker ; Up to date hacking ; hacker.jpg \stopseplisttalk Is there a way to make the \defineseparatedlist command to be more = tolerant for the filename?=20 Best regards: OK > On 30 Jan 2018, at 16:28, Otared Kavian wrote: >=20 >=20 >> On 30 Jan 2018, at 15:54, Wolfgang Schuster = > = wrote: >>> [=E2=80=A6] >>=20 >> Use the command key which grabs the content of each column as = argument (i.e. your commands needs as many arguments as your table has = columns): >>=20 >> \defineseparatedlist >> [seplisttalk] >> [separator=3D{;}, >> command=3D\maketalk] >=20 >=20 > Thanks Wolfgang! That fixes the issues concerning the entries which = are text, but now the filename is not understood by the command = \maketalk: here is the modified code: >=20 > %% begin database-command.tex > \usemodule[database] >=20 > \starttext > \startbuffer[pagetalk] > \starttabulate[|f{\bi}l|p|][before=3D]% > \NC Speaker \EQ=20 > \goto{{\sc = \getvariable{talk}{speakername}}}[fig:\getvariable{talk}{speakername}] > \NC\NR > \NC Title \EQ \getvariable{talk}{title} \NC\NR > \stoptabulate > \startplacefigure[number=3Dno] > \externalfigure[\getvariable{talk}{picture}] > \stopplacefigure > \page > \stopbuffer >=20 > \setvariable{talk}{set}{\getbuffer[pagetalk]} >=20 > \define[3]\maketalk{% > \setvariables[talk]% > [speakername=3D{#1}, > title=3D{#2}, > picture=3D{#3}, > ]} >=20 > \defineseparatedlist[seplisttalk] > [separator=3D{;}, > command=3D\maketalk] >=20 > \startseplisttalk > {Hacker} ; {Up to date hacking} ; {hacker.jpg} > Hacker ; Up to date hacking ; hacker.jpg > \stopseplisttalk >=20 > \stoptext > %% end database-command.tex --Apple-Mail=_CD18B10F-1671-43D7-90F8-292E67C5C8F1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = again Wolfgang,

I = think I understood what is going wrong with my example after your hint: = I have to remove all spaces around the separator and remove also the = braces around each entry.
That is the following = works fine:

\startseplisttalk
Hacker;Up to date = hacking;hacker.jpg
Hacker;Up to date = hacking;hacker.jpg
\stopseplisttalk

while the following does = not (as far as the filename is concerned):

\startseplisttalk
{Hacker};{Up to date = hacking};{hacker.jpg}
Hacker ; Up to date hacking ; = hacker.jpg
\stopseplisttalk

Is there a way to make = the \defineseparatedlist command to be more tolerant for the = filename? 
Best regards: OK

On 30 Jan 2018, at 16:28, Otared Kavian <otared@gmail.com> = wrote:


On 30 = Jan 2018, at 15:54, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
[=E2=80=A6]

Use the command key which grabs the content of each column as argument=20= (i.e. your commands needs as many arguments as your table has = columns):

\defineseparatedlist
  [seplisttalk]
  [separator=3D{;},
   command=3D\maketalk]


Thanks Wolfgang! That fixes the issues = concerning the entries which are text, but now the filename is not = understood by the command \maketalk: here is the modified code:

%% begin = database-command.tex
\usemodule[database]

\starttext
\startbuffer[pagetalk]
= \starttabulate[|f{\bi}l|p|][before=3D]%
\NC = Speaker \EQ 
\goto{{\sc = \getvariable{talk}{speakername}}}[fig:\getvariable{talk}{speakername}]
\NC\NR
\NC Title =   \EQ \getvariable{talk}{title}    \NC\NR
= \stoptabulate
= \startplacefigure[number=3Dno]
= \externalfigure[\getvariable{talk}{picture}]
= \stopplacefigure
= \page
\stopbuffer

\setvariable{talk}{set}{\getbuffer[pagetalk]}

\define[3]\maketalk{%
= \setvariables[talk]%
= [speakername=3D{#1},
= title=3D{#2},
picture=3D{#3},
= ]}

\defineseparatedlist[seplisttalk]
= [separator=3D{;},
= command=3D\maketalk]

\startseplisttalk
{Hacker} ; {Up to = date hacking} ; {hacker.jpg}
Hacker ; Up to date = hacking ; hacker.jpg
\stopseplisttalk

\stoptext
%% end = database-command.tex

= --Apple-Mail=_CD18B10F-1671-43D7-90F8-292E67C5C8F1-- --===============5886176240702938453== 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 X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============5886176240702938453==--