You had it right in your "Else" statement.
i ++should be without a space, so
i++. However, without having access to your Array nor what current_xp is, it's hard to diagnose an issue. And what is it you expect each variables value to be at the end of your process?