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 ___________________________________________________________________________________