From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59770 Path: news.gmane.org!not-for-mail From: Jaroslav Hajtmar Newsgroups: gmane.comp.tex.context Subject: Re: Testing non-existent counter in Lua Date: Tue, 22 Jun 2010 08:35:01 +0200 Message-ID: <4C205995.5050601@gyza.cz> References: <4C1FDC7A.3040604@gyza.cz> <4C205053.1060803@elvenkind.com> 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 1277188516 10674 80.91.229.12 (22 Jun 2010 06:35:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Jun 2010 06:35:16 +0000 (UTC) Cc: mailing list for ConTeXt users To: Taco Hoekwater Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 22 08:35:14 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 1OQx4i-0007wR-3Z for gctc-ntg-context-518@m.gmane.org; Tue, 22 Jun 2010 08:35:12 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EB272C9C4A; Tue, 22 Jun 2010 08:35:10 +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 BV-q3HrswybO; Tue, 22 Jun 2010 08:35:06 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C0A54C9C22; Tue, 22 Jun 2010 08:35:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CBEBDC9C22 for ; Tue, 22 Jun 2010 08:35:05 +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 DWOLupuv4AOw for ; Tue, 22 Jun 2010 08:35:03 +0200 (CEST) Original-Received: from psi2.forpsi.com (smtpa.forpsi.com [81.2.195.204]) by balder.ntg.nl (Postfix) with SMTP id 80D05C9C15 for ; Tue, 22 Jun 2010 08:35:03 +0200 (CEST) Original-Received: (qmail 6615 invoked by uid 89); 22 Jun 2010 06:35:01 -0000 Original-Received: from unknown (HELO ?192.168.1.60?) (hajtmar@gyza.cz@188.116.72.12) by psi02 with ESMTPA; 22 Jun 2010 06:35:01 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 In-Reply-To: <4C205053.1060803@elvenkind.com> 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:59770 Archived-At: Thanx Taco, can I learn about these things somewhere read more? I tried luatexref-t.pdf and I didnt in fact guided. Thanx Jaroslav Dne 22.6.2010 7:55, Taco Hoekwater napsal(a): > Jaroslav Hajtmar wrote: >> 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... > > if token.command_name(token.create('mycount')) == 'assign_int' > and tex.count.mycount == 1 then > ... > end > > Best wishes, > Taco > > ___________________________________________________________________________________ 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 ___________________________________________________________________________________