When you have an error don't just say I have an error. The important info is _which_ error! So please copy-paste it.
Exact error-messags are always the most important part of any error-report.
But if you think a little about it you probably realize that you don't need the whole "else if" part anyway. Actually that it can't even work that way. First you check for the same condition in the "if" than in the "else if" - but if the condition is met for "if" then it never even tries the "else" (and also when the condition is not met it will still not be met when checking it a second time).
The other part is that your KeyIsDown is probably a bool array. You try creating a second array for KeyIsUp... but think for a moment about this. KeyIsDown is either true or false. Now what does it mean when KeyIsDown is false... yep - you already got your up.