Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool2.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Managing error strings in C Message-ID: <1991Jan22.021205.29632@dirtydog.ima.isc.com> Date: 22 Jan 91 02:12:05 GMT References: <1991Jan10.122227@lotus.lotus.com> <620@necssd.NEC.COM> <1991Jan19.163652.9203@hemel.bull.co.uk> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Organization: Interactive Systems Lines: 14 In article <1991Jan19.163652.9203@hemel.bull.co.uk> boyce@hemel.bull.co.uk (David Boyce) writes: >>[Moving all your text strings, including printf formats, into an external >>file also allows it to be translated into other natural languages.] > >There is a problem here, in that different human languages do not >necessarily have the same sentence structure. [So you need to allow argument >reordering as well.] Is there anything like this already around? X/Open has it. "%4$d" means print the 4th argument in decimal. Note that the naive implementation of pulling the nth word from the stack doesn't work even on a vaxlike architecture, since you really need the nth argument rather than the nth word. (E.g. printf("%2$d %3$d %1$f %4$f", 1.0, 2, 3, 4.0) must work.) Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint