At 09:22 PM 10/18/2005 +0200, you wrote: >This brings up another question. When you define a local variable in C, that >variable desolves once the function it has been defined in finishes it's >work. The "static" storage duration qualifier tells the compiler to maintain the state of a variable between calls to a function (and it is also initialized by the startup code, as is a global variable). The scope of the variable is still confined to the function in which it is defined, like the default automatic variables. That hides the names of variables, so you could write something like: int count(void) { static int i; return i++; /* return current value, then increment */ } This will return 0 the first time it is called, and 1 more each successive time it is called, but it doesn't interfere with any other variables named "i" elsewhere in your program. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com ->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist