Comment after \startseparatedlist[...]
Dear list, if there is a comment after \startseparatedlist[...] from the database module, context fails. Thus, this example in the wiki doesn't work: http://wiki.contextgarden.net/M-database Minimal example: \usemodule[database] \defineseparatedlist[Test] [ before=\bTABLE, after=\eTABLE, left=\bTD, right=\eTD, first=\bTR, last=\eTR ] \starttext \startTest % problematic comment Eins, zwei, drei \stopTest \stoptext Kind regards, Joshua Krämer
On 1/20/2014 9:02 PM, Joshua Krämer wrote:
Dear list,
if there is a comment after \startseparatedlist[...] from the database module, context fails. Thus, this example in the wiki doesn't work: http://wiki.contextgarden.net/M-database
Minimal example:
\usemodule[database] \defineseparatedlist[Test] [ before=\bTABLE, after=\eTABLE, left=\bTD, right=\eTD, first=\bTR, last=\eTR ]
\starttext
\startTest % problematic comment Eins, zwei, drei \stopTest
\stoptext
in fact you get: \startTest Eins, zwei, drei \stopTest because of the comment and we ignore all till the end of the first line Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am Mon, 20 Jan 2014 23:41:55 +0100
schrieb Hans Hagen
in fact you get:
\startTest Eins, zwei, drei \stopTest
because of the comment and we ignore all till the end of the first line
I still don't understand it. This works: \startTest Eins, zwei, drei \stopTest This doesn't work (context stops with error): \startTest %Test Eins, zwei, drei \stopTest It seems that context fails whenever there is a comment inside the database listing (or database file). I actually would like to read in a database file and skip the first row, but because of this problem it doesn't work. Kind regards, Joshua
On 1/21/2014 3:39 PM, Joshua Krämer wrote:
Am Mon, 20 Jan 2014 23:41:55 +0100 schrieb Hans Hagen
: in fact you get:
\startTest Eins, zwei, drei \stopTest
because of the comment and we ignore all till the end of the first line
I still don't understand it. This works:
\startTest Eins, zwei, drei \stopTest
This doesn't work (context stops with error):
\startTest %Test Eins, zwei, drei \stopTest
It seems that context fails whenever there is a comment inside the database listing (or database file).
I actually would like to read in a database file and skip the first row, but because of this problem it doesn't work.
has to do with catcode changes so % is no longer % ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am Tue, 21 Jan 2014 17:51:17 +0100
schrieb Hans Hagen
has to do with catcode changes so % is no longer %
Thanks for the hint. I have tried to do it like that (from Mojca Miklavec's "My Way"): \usemodule[database] \unprotect \startsetups Data:unix \catcode`\%=\@@comment \stopsetups \protect \defineseparatedlist [Data] [ separator=tab, before=\bTABLE, after=\eTABLE, first=\bTR, last=\eTR, left=\bTD, right=\eTD, setups=unix ] \starttext \startData % time LG LG-SD HG HG-SD p 24 0.74 0.36 1.19 0.51 0.15 48 0.90 0.65 1.45 0.54 0.21 72 1.23 0.35 1.59 0.59 0.27 \stopData \stoptext ... but still, context stops with an error. I have also tried to use \# like in the My Way example without success. Is this supposed to work? Kind regards, Joshua Krämer
You can add “commentchar=\letterpercent” to your separatedlist definition which will make % the character for comments, the setups hack isn’t necessary.
Wolfgang
On 21.01.2014 23:13:25, Joshua Krämer
has to do with catcode changes so % is no longer %
Thanks for the hint. I have tried to do it like that (from Mojca Miklavec's "My Way"): \usemodule[database] \unprotect \startsetups Data:unix \catcode`\%=\@@comment \stopsetups \protect \defineseparatedlist [Data] [ separator=tab, before=\bTABLE, after=\eTABLE, first=\bTR, last=\eTR, left=\bTD, right=\eTD, setups=unix ] \starttext \startData % time LG LG-SD HG HG-SD p 24 0.74 0.36 1.19 0.51 0.15 48 0.90 0.65 1.45 0.54 0.21 72 1.23 0.35 1.59 0.59 0.27 \stopData \stoptext ... but still, context stops with an error. I have also tried to use \# like in the My Way example without success. Is this supposed to work? Kind regards, Joshua Krämer ___________________________________________________________________________________ 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 ___________________________________________________________________________________
Am Tue, 21 Jan 2014 23:19:43 +0100
schrieb Wolfgang Schuster
You can add “commentchar=\letterpercent” to your separatedlist definition which will make % the character for comments, the setups hack isn’t necessary.
Thank you, I have added it to the Wiki. Kind regards, Joshua Krämer
participants (3)
-
Hans Hagen
-
Joshua Krämer
-
Wolfgang Schuster