ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Request for metapost
Date: Wed, 25 Dec 2013 15:53:01 +0100	[thread overview]
Message-ID: <52BAF14D.7020705@gmx.net> (raw)
In-Reply-To: <52B72B17.3000702@wxs.nl>

Also thanks from my side. Just what I needed for further tests (graphics
with multiple paths).

Peter


Am 22.12.2013 19:10, schrieb Hans Hagen:
> \starttext
> 
> % \enabletrackers[metapost.variables]
> 
> \startMPcode
>     numeric n[]   ; for i=1 upto 10: n[i] := 1/i ; endfor ;
>     path    p[]   ; for i=1 upto 10: p[i] := fullcircle xyscaled
> (cm*i,cm/i) ; endfor ;
>     numeric r[][] ; for i=1 upto 4 : for j=1 upto 3 : r[i][j] :=
> uniformdeviate(1) ; endfor ; endfor ;
>     pair    u[][] ; for i=1 step 0.5 until 4 : for j=1 step 0.1 until 2
> : u[i][j] := (i,j) ; endfor ; endfor ;
> 
>     passvariable("x",12345) ;
>     passarrayvariable("n-array",n,1,7,1) ;
>     passarrayvariable("p-array",p,1,7,1) ;
>     passvariable("p",(1,1) .. (2,2)) ;
> 
>     startpassingvariable("b")
>         startarray
>             for i=1 upto 4 :
>                 startarray
>                     for j=1 upto 3 :
>                         value(r[i][j])
>                     endfor
>                 stoparray
>             endfor
>         stoparray
>     stoppassingvariable ;
> 
>     startpassingvariable("a")
>         starthash
>             key("test 1")
>                 startarray
>                     value(123)
>                     value(456)
>                 stoparray
>             key("test 2")
>                 startarray
>                     index(0)
>                     value(123)
>                     value(456)
>                     value(789)
>                     slot(999,987)
>                 stoparray
>             key("test 3")
>                 starthash
>                     key("first") value(789)
>                     entry("second",987)
>                 stophash
>         stophash
>     stoppassingvariable ;
> 
>     startpassingvariable("c")
>         startarray
>             for i=1 step 0.5 until 4 :
>                 index(i)
>                 startarray
>                     for j=1 step 0.1 until 2 :
>                         slot(j,u[i][j])
>                     endfor
>                 stoparray
>             endfor
>         stoparray
>     stoppassingvariable ;
> 
>     draw fullcircle scaled 1cm ;
> \stopMPcode
> 
> \ctxluacode{inspect(metapost.variables)}
> 
> \ctxcommand{mprunvar("x")}
> 
> \stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      parent reply	other threads:[~2013-12-25 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-21 11:50 DesdeChaves
2013-12-22 14:57 ` Hans Hagen
2013-12-22 18:10   ` Hans Hagen
2013-12-23 14:31     ` DesdeChaves
2013-12-23 15:52       ` DesdeChaves
2013-12-23 16:21         ` Hans Hagen
2013-12-25 14:53     ` Peter Rolf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52BAF14D.7020705@gmx.net \
    --to=indiego@gmx.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).