Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!uunet!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.text.tex Subject: Re: Testing for null arguments Message-ID: Date: 14 Mar 91 22:03:20 GMT References: <5396@vela.acs.oakland.edu> <68473@brunix.UUCP> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 23 gvr@cs.brown.edu (George V. Reilly) writes: >\def\part#1#2#3{% > \def\first{#1} % Or something with more mnemonic value > \def\third{#1} > [some code] > % > \ifx\first\empty > % do nothing > \else > [some more code] > \fi Another way of testing for null arguments is exemplified by this macro: \def\showempty#1{\message{\ifx\relax#1\relax empty\else not empty\fi}} This has the advantage that it can be done entirely in TeX's mouth, whereas the \def's in Geo's solution cannot. It does however fail badly if #1 begins with \relax (e.g., \showempty{\relax...}). I have the feeling that there is a better solution. , Eamonn