[NTG-context] Struggling with startuseMPgraphic and string argument!

Geert Verhaag verhaaggchm at ziggo.nl
Wed Sep 16 16:32:00 CEST 2020


Hi,

I'm trying to pass a string argument value to an MPgraphic but it 
doesn't seem to work:

Tried the following:

\startuseMPgraphic{name}{lbl}
   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
   \useMPgraphic{name}{lbl=1}
\stoptext

The above works as expected!

But the following doesn't:

\startuseMPgraphic{name}{lbl}
   pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
\stopuseMPgraphic

\starttext
   \useMPgraphic{name}{lbl=abc}
\stoptext

It yields:

  1 \startuseMPgraphic{name}{lbl}
  2       pair a ; a := (3cm,3cm) ;label.top("\MPvariable{lbl}",a) ;
  3     \stopuseMPgraphic
  4
  5     %\startuseMPgraphic{name}fill fullcircle scaled 200pt withcolor 
.625yellow ;\stopuseMPgraphic
  6
  7     \starttext
  8      Example:
  9 >>    \useMPgraphic{name}{lbl=abc}
10     \stoptext
11

<to be read again>
a
\m_meta_current_variable a-a
                             bc
<argument> ... \hbox {\scratchdimen \m_meta_current_variable
                                                   sp}\ifzeropt \wd 
\b_meta_v...
\secondoftwoarguments #1#2b-#2

\9>>1 #1,2-\meta_prepare_instance_variable {#1}
\syst_helpers_do_process_comm...
\syst_helpers_do_process_comma_list ...rgument #1,
                                                   ]\relax \global 
\advance \...
...
l.9   \useMPgraphic{name}{lbl=abc}

So it seems that only numbers can be passed not character strings! Why 
is that? Is there a possibility to achieve this functionality?

Regards,
Gerard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200916/946d295d/attachment-0001.htm>


More information about the ntg-context mailing list