ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <hraban@fiee.net>
Subject: optional arguments, if(nth)argument
Date: Thu, 6 Jan 2005 20:24:47 +0100	[thread overview]
Message-ID: <A08CC25C-6018-11D9-AD4B-0030659899AA@fiee.net> (raw)

Hello again!

Today I'm trying a lot of new (to me) things...
This time, a macro with optional arguments and \if...argument :

\def\SkillField{\dodoubleempty\doSkillField}

\def\doSkillField[#1][#2]#3{\bTR\bTD #3
	\iffirstargument\hfill (#1)\fi     % don't print when no optional 
argument
	\eTD \bTD
	\ifsecondargument                  % if second optional arg is provided
		\definefield[#2][line][Skill][#1]\field[#2]
	\else                              % if no second optional arg
		\definefield[#3][line][Skill][#3]\field[#3]
	\fi
	\eTD\eTR}

e.g.
\SkillField[+8][Aergern]{Ärgern} % works
\SkillField[+1]{Labern} % does nothing instead of "else"
\SkillField{Testen} % does "\hfill (#1)", but should do nothing

Apparently, the \if...argument ... \else don't work as they should.
Where's my mistake?


Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net

             reply	other threads:[~2005-01-06 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06 19:24 Henning Hraban Ramm [this message]
2005-01-07  9:23 ` Taco Hoekwater

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=A08CC25C-6018-11D9-AD4B-0030659899AA@fiee.net \
    --to=hraban@fiee.net \
    --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).