From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/43704 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: system macros/doquadrupleemtpy Date: Wed, 03 Sep 2008 20:32:05 +0200 Message-ID: <48BED825.9090100@gmx.net> 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: ger.gmane.org 1220472552 7681 80.91.229.12 (3 Sep 2008 20:09:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 20:09:12 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 03 22:10:07 2008 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 1Kayfv-0006RW-PR for gctc-ntg-context-518@m.gmane.org; Wed, 03 Sep 2008 22:09:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5B8F71FEFF; Wed, 3 Sep 2008 22:08:20 +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 08673-05-30; Wed, 3 Sep 2008 22:07:28 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 196451FD76; Wed, 3 Sep 2008 21:53:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 792141FC98 for ; Wed, 3 Sep 2008 21:52:11 +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 05874-02-28 for ; Wed, 3 Sep 2008 21:51:04 +0200 (CEST) Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by ronja.ntg.nl (Postfix) with SMTP id 6C96D1FCA1 for ; Wed, 3 Sep 2008 20:32:09 +0200 (CEST) Original-Received: (qmail invoked by alias); 03 Sep 2008 18:32:06 -0000 Original-Received: from i5387D8A5.versanet.de (EHLO [192.168.1.3]) [83.135.216.165] by mail.gmx.net (mp018) with SMTP; 03 Sep 2008 20:32:06 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX1881xAoveI8xwaqjk68TAGRTojVey0H1plqC4vi51 pk3hXkvctDjEem User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: X-Enigmail-Version: 0.95.7 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 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:43704 Archived-At: Thomas A. Schmitz schrieb: > Hi all, > > I'm trying to define a macro \Command which can either have four or > five arguments. If it has five, I want to define them as > > \Command1[#1][#2][#3][#4]{#5} > > if it has four, as > > \Command2[#1][#2][#3]{4#} > > I thought this would be the way to go: > > \def\Command{% > \doquadrupleempty\doCommand} > > \def\doCommand{% > \iffifthargument% > \doquadrupleargument\Command1% > \else% > \dotripleargument\Command2% > \fi} > > but that gives me errors about "too many }s". So I'm wondering: am I > on the wrong track? Can this be done at all? > Hi Thomas! Hard to say for me whats wrong, but I think its a bad idea to use such optional parameter commands in a nested way. Also there is no need for a second parameter number check. How about something like \def\doCommand% {\iffifthargument \CommandA[#1][#2][#3][#4]{#5}% \else\iffourthargument \CommandB[#1][#2][#3]{#4}% \else % some error handling \fi \fi} Best wishes, Peter > Thanks, and best > > Thomas > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ > ___________________________________________________________________________________ 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 ___________________________________________________________________________________