From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22876 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: getvariable Date: Wed, 5 Oct 2005 23:12:06 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1128546946 12181 80.91.229.2 (5 Oct 2005 21:15:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2005 21:15:46 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 05 23:15:45 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1ENGZz-0003KI-4R for gctc-ntg-context-518@m.gmane.org; Wed, 05 Oct 2005 23:13:35 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D432D1279D; Wed, 5 Oct 2005 23:13:34 +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 17170-03-4; Wed, 5 Oct 2005 23:13:29 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D7C90127B0; Wed, 5 Oct 2005 23:13:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 49E6D127B0 for ; Wed, 5 Oct 2005 23:13:29 +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 17170-03-3 for ; Wed, 5 Oct 2005 23:13:27 +0200 (CEST) Original-Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by ronja.ntg.nl (Postfix) with ESMTP id A1D2C1279D for ; Wed, 5 Oct 2005 23:13:27 +0200 (CEST) Original-Received: from fwd30.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1ENGZr-0001yM-00; Wed, 05 Oct 2005 23:13:27 +0200 Original-Received: from [192.168.0.2] (TEOJUmZrQeAMolqeVpOE+iIR8GQQPns1fzJpEBOHPGIkkqaKa7JcwL@[84.172.120.215]) by fwd30.sul.t-online.de with esmtp id 1ENGZc-0IbH7I0; Wed, 5 Oct 2005 23:13:12 +0200 Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.734) X-ID: TEOJUmZrQeAMolqeVpOE+iIR8GQQPns1fzJpEBOHPGIkkqaKa7JcwL@t-dialin.net X-TOI-MSGID: c45a70b4-2704-4220-929c-a60da7a90a96 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22876 Archived-At: I thought I had understood at least some aspects of macros, but it turns out I'm as lost as always. Here's my problem: I'm writing a module which will have a \setupcommand. The value is given in a [key=pair] list, so I thought I could use \getvariable. What I have is \def\setupcommand{\setvariables[namespace]} % setting up the namespace \setvariables[namespace][key=value,otherkey=value] % initializing the keys % And now I want to wrap my values up in a conditional statement: \doifelse{\getvariable{namespace}{key}}{value} {do something} {do something else} When I put the \doifelse statement into my source files, the test works; the key is assigned the value that is in the setupcommand. But this doesn't work at runtime: either \getvariable{namespace}{key} always has the value I assign in the line \setvariables[namespace] [key=value,otherkey=value], or if I comment out that line, the variable is empty. I can see why this is the case: the setupcommand is read AFTER the module, so at runtime, the variable is not assigned yet. So my approach seems fundamentally flawed. What could I do instead? Thanks for your help Thomas