You are asking a lot of the same question: please start to think about your code instead of just going "I'll post it here and they will fix it for me" - you will learn a lot more, and be able to fix trivial problems like these quicker by yourself than we will!
This is the same problem you have here:
Error:operator '>' cannot be applied to operands of type 'void' and 'int'[
^] Different method, same problem.
And the same solution! Autonumber returns a void, not a valid result.