[NTG-context] [passing parameter into MPpage]

Hans Hagen j.hagen at xs4all.nl
Fri Feb 12 12:58:17 CET 2021


On 2/12/2021 12:42 PM, Floris van Manen wrote:
> What is the correct ways to pass parameters into a \startMPpage section?
> This does not produce a page (obviously if you know how it works)
> But how to get the intende output?
> 
> 
> \def\blz[#1][#2][#3]{
> \startMPpage
> draw thefmttext(#1) shifted(10mm, 20mm);
> draw thefmttext(#2) shifted(10mm, 205m);
> draw thefmttext(#3) shifted(10mm, 30mm);
> \stopMPpage
> }
> 
> \blz[01][02][AA]
> 
> \blz[03][42][ZZ]
whatever suits your purpose or taste, like

\def\blz[#1]%
   {\begingroup
      \setvariables[blz][#1]%
      \startMPpage
          draw textext("\getvariable{blz}{a}") shifted(10mm, 10mm);
          draw textext("\getvariable{blz}{b}") shifted(10mm, 20mm);
          draw textext("\getvariable{blz}{c}") shifted(10mm, 30mm);
      \stopMPpage
    \endgroup}

\blz[a=01,b=02,c=AA]




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list