diff options
author | Hans Hagen <pragma@wxs.nl> | 2004-06-10 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2004-06-10 00:00:00 +0200 |
commit | 51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725 (patch) | |
tree | a902c3c67fe2272ee9e2325d6a6f28f0fd15d9d8 /tex/context/base/core-dat.tex | |
parent | ab3f887feadf929129087cd2cbc3783064507565 (diff) | |
download | context-51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725.tar.gz |
stable 2004.06.10
Diffstat (limited to 'tex/context/base/core-dat.tex')
-rw-r--r-- | tex/context/base/core-dat.tex | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tex/context/base/core-dat.tex b/tex/context/base/core-dat.tex index 2389aa616..239b27d70 100644 --- a/tex/context/base/core-dat.tex +++ b/tex/context/base/core-dat.tex @@ -83,55 +83,55 @@ %D A database file |<|in most cases such a base is generated %D from another one|>| is structured as follows: %D -%D \starttypen +%D \starttyping %D \startrecord{tag} %D \memberofgroup{grouplist} %D \setrecordentry{name}{...} %D .... %D \stoprecord -%D \stoptypen +%D \stoptyping %D %D The interface to such a database is defined as follows: %D -%D \starttypen +%D \starttyping %D \definerecord[class][settings] %D \setuprecord[class][settings] %D \definerecordentry[class][name] -%D \stoptypen +%D \stoptyping %D %D and processed by %D -%D \starttypen +%D \starttyping %D \processrecords[file list][tag and/or group list] -%D \stoptypen +%D \stoptyping %D %D The actual processing is done by a macro assigned to \type %D {command}: %D -%D \starttypen +%D \starttyping %D \setuprecord[class][command=\DoWithRecord] -%D \stoptypen +%D \stoptyping %D %D Given that one can ask for a field with %D -%D \starttypen +%D \starttyping %D \getrecordentry{name} -%D \stoptypen +%D \stoptyping %D %D such a command can look like: %D -%D \starttypen +%D \starttyping %D \def\DoWithRecord#1% %D {\startpacked %D \let\\=\quad %D name: \getrecordentry{name}~\getrecordentry{family name}\par %D address: \getrecordentry{postal address}\par %D \stoppacked} -%D \stoptypen +%D \stoptyping %D %D The argument passed is the tag. The database can look like: %D -%D \starttypen +%D \starttyping %D \startrecord{hagenj} %D \memberofgroup{a,b} %D \setrecordentry{naam}{Hans} @@ -145,27 +145,27 @@ %D \setrecordentry{family name}{Otten} %D \setrecordentry{postal address}{A.F. Otten\\Prinsengracht 17\\Hasselt NL} %D \stoprecord -%D \stoptypen +%D \stoptyping %D %D The definition of this database looks like: %D -%D \starttypen +%D \starttyping %D \definerecord[address][command=\DoWithRecord] %D %D \definerecordentry[address][name] %D \definerecordentry[address][family name] %D \definerecordentry[address][postal address] -%D \stoptypen +%D \stoptyping %D %D The actual processing is now done by (for instance): %D -%D \starttypen +%D \starttyping %D \processrecords[datafile][hagenj] %D \processrecords[datafile][hagenj,offenaf] %D \processrecords[datafile][all] %D \processrecords[datafile][a] %D \processrecords[datafile][b] -%D \stoptypen +%D \stoptyping %D %D Of course one can reassign the command used to handle the %D records in between. @@ -185,7 +185,7 @@ {\getparameters [\??db#1] [\c!velden=, - \c!commando=\gobbleoneargument, + \c!command=\gobbleoneargument, #2]} \def\setuprecord @@ -225,13 +225,13 @@ \processcommacommand[\getvalue{\??db#1\c!velden}]\docommando \let\setrecordentry\skiprecord \the\resetrecordlist - \doifelse{#2}\v!alles % 't Is nu eenmaal alles + \doifelse{#2}\v!all % 't Is nu eenmaal alles \recordoktrue {\doifelsenothing{#2} % of niets \recordoktrue \recordokfalse}% % zullen we maar zeggen. \ifrecordok - \let\askedrecords\v!alles + \let\askedrecords\v!all \else \makerawcommalist[#2]\askedrecords \fi @@ -264,7 +264,7 @@ {\relax \egroup %\the\everyrecord - \getvalue{\??db#1\c!commando}{##1}}% + \getvalue{\??db#1\c!command}{##1}}% \showmessage\m!databases1\askedrecords \def\doprocessrecords##1% {\readjobfile{##1} |