On 13-7-2010 6:01, Stefan Müller wrote:
Hi,
I just tried to build my own object in metaobj but for some reason I cannot figure out it does not work. I tried the example from the metaobj manual in a tex document (it works in a metapost file):
\startuseMPgraphic{objecttest} vardef newSegment@#= assignObj(@#,"Segment"); ObjPoint a,b; ObjCode "@#b-@#a=(1cm,2cm)"; enddef; \stopuseMPgraphic
When processing this with context (MkIV) I get
! Illegal parameter number in definition of \@MPG@objecttest. <to be read again> = <argument> vardef newSegment@##= assignObj(@##,"Segment"); ObjPoint a,b; Ob... \dostartuseMPgraphic ...leuseMPgraphic {#1}{#2}{#3 }} l.7 \stopuseMPgraphic
My first wild guess is that it has something to do with the "evil" @-symbol. But even if this is the case I don't know what to do to fix this. Any help appreciated and thank you very much in advance.
no, more with # being special to tex's parser \string# or \# will probably do ----------------------------------------------------------------- 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 -----------------------------------------------------------------