Re: [NTG-context] Problem with show command in MetaFun

2021-01-07 Thread Keith McKay

Thanks Hans!

I had forgotten about \enabletrackers[metapost.tracingall].

Best Wishes

Keith

On 07/01/2021 15:35, Hans Hagen wrote:

On 1/7/2021 4:11 PM, Keith McKay wrote:
In the MWE below I would expect the "show" command to print the value 
of p in the console output (I use Texworks), however this does not 
seem to be happening. I haven't used "show" in MetaFun for a while, 
am I implementing it correctly?


Best Wishes

Keith McKay

 MWE %

\setuppapersize[A4, portrait]

\starttext

\startMPpage

StartPage;

width := PaperWidth ; height := PaperHeight ; unit := cm ;

numeric p;

p := 0;

for q = 0 step 1 until 10:

show p;

p := p + 1;

fill fullcircle xyscaled(3cm,4cm) shifted ((p +2)*cm, (p + 2)*cm) 
withcolor red ;


endfor;

StopPage;

\stopMPpage

\stoptext


\enabletrackers[metapost.tracingall]


but best use:

message(p);

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

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Problem with show command in MetaFun

2021-01-07 Thread Hans Hagen

On 1/7/2021 4:11 PM, Keith McKay wrote:
In the MWE below I would expect the "show" command to print the value of 
p in the console output (I use Texworks), however this does not seem to 
be happening. I haven't used "show" in MetaFun for a while, am I 
implementing it correctly?


Best Wishes

Keith McKay

 MWE %

\setuppapersize[A4, portrait]

\starttext

\startMPpage

StartPage;

width := PaperWidth ; height := PaperHeight ; unit := cm ;

numeric p;

p := 0;

for q = 0 step 1 until 10:

show p;

p := p + 1;

fill fullcircle xyscaled(3cm,4cm) shifted ((p +2)*cm, (p + 2)*cm) 
withcolor red ;


endfor;

StopPage;

\stopMPpage

\stoptext


\enabletrackers[metapost.tracingall]


but best use:

message(p);

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Problem with show command in MetaFun

2021-01-07 Thread Keith McKay
In the MWE below I would expect the "show" command to print the value of 
p in the console output (I use Texworks), however this does not seem to 
be happening. I haven't used "show" in MetaFun for a while, am I 
implementing it correctly?


Best Wishes

Keith McKay

 MWE %

\setuppapersize[A4, portrait]

\starttext

\startMPpage

StartPage;

width := PaperWidth ; height := PaperHeight ; unit := cm ;

numeric p;

p := 0;

for q = 0 step 1 until 10:

show p;

p := p + 1;

fill fullcircle xyscaled(3cm,4cm) shifted ((p +2)*cm, (p + 2)*cm) 
withcolor red ;


endfor;

StopPage;

\stopMPpage

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___