All pastes #796793 Raw Edit

Stuff

public text v1 · immutable
#796793 ·published 2007-11-25 12:38 UTC
rendered paste body
			switch (command.ID) {
				case CommandID.Text:
					Int32 index;
					if (!Int32.TryParse(command.Parameters[0], out index)) return false;
					if (index < 1 || index > 3) return false;
					// TODO
					return true;
				case CommandID.Led:
					Int32 index;
					if (!Int32.TryParse(command.Parameters[0], out index)) return false;
					if (!Enum.IsDefined(typeof(Leds), index)) return false;
					bool state;
					if (!Boolean.TryParse(command.Parameters[1], out state)) return false;
					// TODO
					return true;
			}

This gives the error:
A local variable named 'index' is already defined in this scope

for the second "Int32 index;" line. But that is in another case...?