From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Test whether variable has been set
Date: Sun, 27 May 2007 11:55:21 -0400 (EDT) [thread overview]
Message-ID: <alpine.WNT.0.99.0705271148450.548@nqvgln> (raw)
In-Reply-To: <e65d34bf0705270758le3e64cfq4c4eda52ee88017e@mail.gmail.com>
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
___________________________________________________________________________________
next prev parent reply other threads:[~2007-05-27 15:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-27 14:58 Elliot Clifton
2007-05-27 15:55 ` Aditya Mahajan [this message]
2007-05-27 16:15 ` Hans Hagen
2007-05-27 18:15 ` Peter Rolf
-- strict thread matches above, loose matches on Subject: below --
2007-05-27 11:15 Elliot Clifton
2007-05-27 13:26 ` Peter Rolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.WNT.0.99.0705271148450.548@nqvgln \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).