Joel Parker wrote: > The best I can tell, most people use either global variables (such as > errno) Yucc. I know Unix does this, but using a global like that is a bad idea, at least in code on general purpose machines where a few cycles don't matter. > or return codes to flag errors within each function, then > check for those errors once the function returns. That's exactly what I do for my host code. Any subroutine that could fail, like just about all I/O routines, returns a variable I usually call STAT of type SYS_ERR_T. That is a structure that can contain my own subsystem code and status code within the subsystem, or it can indicate a system error code. I also have a bunch of routines that convert these codes to error messages and the like, but that's another discussion. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist