From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/34795 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Test whether variable has been set Date: Sun, 27 May 2007 11:55:21 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1180281344 8845 80.91.229.12 (27 May 2007 15:55:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 May 2007 15:55:44 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun May 27 17:55:42 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1HsL5q-00052I-5r for gctc-ntg-context-518@m.gmane.org; Sun, 27 May 2007 17:55:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 73B881FB71; Sun, 27 May 2007 17:55:40 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21981-02-4; Sun, 27 May 2007 17:55:32 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D53DE1FB5E; Sun, 27 May 2007 17:55:31 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 38D4A1FB5A for ; Sun, 27 May 2007 17:55:30 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21981-02-3 for ; Sun, 27 May 2007 17:55:26 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with ESMTP id 9B4501FB5E for ; Sun, 27 May 2007 17:55:25 +0200 (CEST) Original-Received: FROM aditya.cable.rcn.com (207-229-157-251.mart-bsr1.chi-mart.il.cable.rcn.com [207.229.157.251]) BY hackers.mr.itd.umich.edu ID 4659A9EB.218EF.19494 ; 27 May 2007 11:55:23 -0400 In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:34795 Archived-At: On Sun, 27 May 2007, Elliot Clifton wrote: > Hi Peter, > > Thanks for your reply. I think I may have misunderstood the variable > section on the wiki. I been using \setvariable to both declare and > assign variables from my component files. When I should have been > declaring them in the environment file first, right? > \setvariable[namespace][key=DefaultValue], right? So how do I test for > a (Default)Value? > Sorry, I'm just beginning TeX programming I don't understand how to do this. Elliot, You can use \doif{\getvalue{set}{var}}{value} for simple string comparisons. See http://wiki.contextgarden.net/System_Macros for basic flow control features of ConTeXt. It may also be possble to see if variables have changed using setups http://wiki.contextgarden.net/Inside_ConTeXt#Using_setups_for_namespaces but I have never personally used that. Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________