I have found the following to be helpful with what I call 'Logical' states: #define RESET -1 /* this is actually Tri-stated */ #define UNSET 0 #define SET 1 short flag = UNSET; ... if (flag == UNSET) { /* or == SET or == RESET */ ... } and so on... --rkl