On 1/23/07, Wolfgang Werners-Lucchini wrote:
Hallo!
I tried some examples with m-database and Mojca's 'My Way' and had some problems
==========Example-1=============================================== \defineseparatedlist[NaturalTable][separator=comma,%quotechar={"}, before=\bTABLE, after=\eTABLE, first=\bTR, last=\eTR, left=\bTD, right=\eTD]
\startseparatedlist[NaturalTable] Of,course ,it is! \stopseparatedlist ================================================================== This example does only work as expected if one explicitly gives quotechar. So what is the default quotechar? Can anybody explain the above behaviour?
If you activate "quotechar", you're using completely other macros to process the data (CSV-like), \TeX-commands won't work. I first wanted to write that the example above without quotechar is a documented bug. But then I remembered that it was already fixed. I looked at the csv.tex again and tried to process it when I figured out that it doesn't even compile any more. Hmmm ... I don't have time to play until friday. It might be that I have some weird local version of m-database which is causing me problems or vice versa. I'll take a look at the end of the week (but I don't know how to fix serious bugs, so it will still be Hans's turn to fix what I find). With quotechar it probably works because Taco's code (with quotechar) was less buggy than Hans's ;) A bit of history: when I asked for that "module", I got two responses - one from Hans and one from Taco. Each one of them has "invented" his own way of dealing with such input, but Taco's way works like \type{\TeX will be ignored}, while Hans's way obeys \TeX commands, so you can use \bf and such ... Since they were both useful, Taco has merged the two. But the difference is probably not documented well enough. ==========Example-2===============================================
\def\Whatever#1#2#3{[#1][#2][#3]\endgraf}
\defineseparatedlist[CSVX][command=\Whatever, separator={,}, % quotechar={"}, first=\bTR,last=\eTR, left=\bTD,right=\eTD, before=\bTABLE,after=\eTABLE]
\startCSVX eins,"und, zwei",drei one,two,three \stopCSVX ================================================================== If I give an command (\Whatever) then the options 'first', 'last', 'left', 'right', 'before' and 'after' are ignored. That's ok, I think!
I guess that I asked Hans for that behaviour, although it could be either way. I don't know if that's sensible or not, but you can place "first" and "last" inside the definition of \Whatever; "left" and "right" might need slightly more typing (if you decide that you need to do something repetitive on all the nine cells, so perhaps that's not so useless), but when I think a bit more about it ... "before" and "after" don't have their counterpart. It's a bad practice to define both command and left/right/first/last anyway ... so perhaps at least before and after (maybe left/right) should be enabled again? (I always have problems because I never know which one does what - I always mix up left/before/first ...)
But if I uncomment the quotechar option, then the options 'left' and 'right' are no longer ignored. Commenting them out or settings like 'left=' etc. are not working. What I am doing wrong here?
Taco's mode works differently. It's probably because I never tested that and/or reported problems. Thing should better be unified in this respect. (I have to test a bit - end of week.) ==========Example-3===============================================
\processquotedlist(){,}{"}\command(a=>b=>c=>d) ================================================================== Does not work for me. Can anybody give an example?
The thing right to \command is purely symbolic I guess (but don't aks me how "Taco's ugliest macro" works ;). But: it's low-level command I guess. It's not "documented" in MyWay either.
'\processseplist' does not work too. There has to be an '%' in front of 'raw'!
You're probably right about that '%'. But \processseplist should be an internal command unless I'm missing something. (LaTeX uses lots of '@' for internals and has so unreadable code ... ConTeXt has better readability, but I sometimes feel that some commands should be better hidden from the outside world - most low-level commands are "visible" to the user, which shouldn't be the case). Mojca