static int SetFlag (Entry entry, int oldValue) { int newValue; return int.TryParse (entry.Text, out newValue) ? newValue : oldValue; }