From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59765 Path: news.gmane.org!not-for-mail From: Jaroslav Hajtmar Newsgroups: gmane.comp.tex.context Subject: Testing non-existent counter in Lua Date: Mon, 21 Jun 2010 23:41:14 +0200 Message-ID: <4C1FDC7A.3040604@gyza.cz> Reply-To: hajtmar@gyza.cz, mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277156485 12699 80.91.229.12 (21 Jun 2010 21:41:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Jun 2010 21:41:25 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 21 23:41:24 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OQok7-0007Qn-VB for gctc-ntg-context-518@m.gmane.org; Mon, 21 Jun 2010 23:41:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 052E7C9C3E; Mon, 21 Jun 2010 23:41:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 92WLsDEmBuAK; Mon, 21 Jun 2010 23:41:19 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9F9A2C9C01; Mon, 21 Jun 2010 23:41:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 62690C9C01 for ; Mon, 21 Jun 2010 23:41:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kkzxir3bMdV5 for ; Mon, 21 Jun 2010 23:41:16 +0200 (CEST) Original-Received: from psi3.forpsi.com (smtpa.forpsi.com [81.2.195.204]) by balder.ntg.nl (Postfix) with SMTP id 28996C9BFF for ; Mon, 21 Jun 2010 23:41:16 +0200 (CEST) Original-Received: (qmail 30256 invoked by uid 89); 21 Jun 2010 21:41:12 -0000 Original-Received: from unknown (HELO ?192.168.1.2?) (hajtmar@gyza.cz@88.103.230.14) by psi03 with ESMTPA; 21 Jun 2010 21:41:12 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:59765 Archived-At: Hi, all. How do I know (due Lua) that the counter has not been defined in ConTeXt (through the command newcount)? I am trying testing : if tex.count.mycount == nil then... or if tex.count.mycount == 'error' then... then when counter isnt defined due \newcount\mycount, then test ending with error message. When counter is defined due \newcount\mycount, \mycount=1 then test if tex.count.mycount == 1 then... is OK... Thanx, Jaroslav ___________________________________________________________________________________ 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 ___________________________________________________________________________________