> -----Original Message----- > From: Bob Ammerman [SMTP:RAMMERMAN@PRODIGY.NET] > Sent: Wednesday, April 11, 2001 12:38 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [OT]: Coding style > > bool _stdcall X9241Write(unsigned char address, > unsigned char instruction) > { > return > I2CStart() && > I2CTransmit(fullAddr) && > I2CGetAck() && > I2CTransmit(instruction) && > I2CGetAck() && > I2CStop(); > } > This is very compact and not a goto or multiple return in sight. I'm presuming the compiler will compile this such that any one function returning a fail will immediately cause the function to return false without calling any further functions. Is this a reasonable assumption, and will it hold true for any (Ansi) C compiler? Mike -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads