ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \systemparameter{n}
@ 2012-05-03 17:01 Peter Rolf
  2012-05-06 20:26 ` \systemparameter{n} Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Rolf @ 2012-05-03 17:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

the system parameter 'n' is not properly set on the third run.

% test.tex
\starttext

\ifnum\systemparameter{n}=1\relax
  \ctxlua{print("*** 1st run")}\fi
\ifnum\systemparameter{n}=2\relax
  \ctxlua{print("*** 2nd run")}\fi
\ifnum\systemparameter{n}=3\relax
  \ctxlua{print("*** 3rd run")}\fi

\stoptext
% ------------

A fresh run (three runs) gives

*** 1st run
*** 2nd run
*** 2nd run


Peter
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \systemparameter{n}
  2012-05-03 17:01 \systemparameter{n} Peter Rolf
@ 2012-05-06 20:26 ` Hans Hagen
  2012-05-07  8:00   ` \systemparameter{n} Peter Rolf
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2012-05-06 20:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3-5-2012 19:01, Peter Rolf wrote:
> Hi,
>
> the system parameter 'n' is not properly set on the third run.
>
> % test.tex
> \starttext
>
> \ifnum\systemparameter{n}=1\relax
>    \ctxlua{print("*** 1st run")}\fi
> \ifnum\systemparameter{n}=2\relax
>    \ctxlua{print("*** 2nd run")}\fi
> \ifnum\systemparameter{n}=3\relax
>    \ctxlua{print("*** 3rd run")}\fi
>
> \stoptext
> % ------------
>
> A fresh run (three runs) gives
>
> *** 1st run
> *** 2nd run
> *** 2nd run

from core-sys:

     \ifcase\directsystemparameter\c!n\relax
         %                        % 0 : unknown
     \or
         \setsystemmode\v!first   % 1 : first run
     \or
         %                        % 2 : successive run
     \or
         \setsystemmode\v!first   % 3 : first and only run
     \or
         \setsystemmode\v!last    % 4 : (extra) last run
     \fi

the run  number is \systemparameter{m}

Hans

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: \systemparameter{n}
  2012-05-06 20:26 ` \systemparameter{n} Hans Hagen
@ 2012-05-07  8:00   ` Peter Rolf
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Rolf @ 2012-05-07  8:00 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Am 06.05.2012 22:26, schrieb Hans Hagen:
> On 3-5-2012 19:01, Peter Rolf wrote:
>> Hi,
>>
>> the system parameter 'n' is not properly set on the third run.
>>
>> % test.tex
>> \starttext
>>
>> \ifnum\systemparameter{n}=1\relax
>>    \ctxlua{print("*** 1st run")}\fi
>> \ifnum\systemparameter{n}=2\relax
>>    \ctxlua{print("*** 2nd run")}\fi
>> \ifnum\systemparameter{n}=3\relax
>>    \ctxlua{print("*** 3rd run")}\fi
>>
>> \stoptext
>> % ------------
>>
>> A fresh run (three runs) gives
>>
>> *** 1st run
>> *** 2nd run
>> *** 2nd run
> 
> from core-sys:
> 
>     \ifcase\directsystemparameter\c!n\relax
>         %                        % 0 : unknown
>     \or
>         \setsystemmode\v!first   % 1 : first run
>     \or
>         %                        % 2 : successive run
>     \or
>         \setsystemmode\v!first   % 3 : first and only run
>     \or
>         \setsystemmode\v!last    % 4 : (extra) last run
>     \fi
> 
> the run  number is \systemparameter{m}
> 

Thanks Hans. No unwanted batch start in the third run anymore. :-)
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-07  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 17:01 \systemparameter{n} Peter Rolf
2012-05-06 20:26 ` \systemparameter{n} Hans Hagen
2012-05-07  8:00   ` \systemparameter{n} Peter Rolf

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).