Path: utzoo!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UUCP (Tom Neff) Newsgroups: comp.lang.c Subject: Re: What I'd really like to see in an if-statement... Message-ID: <14522@bfmny0.UUCP> Date: 7 Aug 89 16:10:47 GMT References: <5024@alvin.mcnc.org> <1300@atanasoff.cs.iastate.edu> <456@helios.prosys.se> <14521@bfmny0.UUCP> <1864@salgado.Solbourne.COM> Reply-To: tneff@bfmny0.UUCP (Tom Neff) Organization: ^ Lines: 15 I suppose I might as well point out that if speed is not crucial, you could always code a C function to do the triadic compare: if (triadc(min, '<', thisval, '<=', max)) ... note using char for the two "operators" as above only works if type int will accomodate two characters, which is usually but not universally true. You could also define special symbols for <= and >= and thus express them in one character, or you could use string pointers or enum constants like if (triadc(min, LESS_THAN, thisval, LESS_OR_EQUAL, max)) ... -- "We walked on the moon -- (( Tom Neff you be polite" )) tneff@bfmny0.UU.NET