To be fair I'm guessing rolfk was just suggesting another path. If you would have opened with the simple solution he may have replied with the "better way to program" answer.
You see this alot on the forums (and I do it myself). Someone will ask a question and an answer will have already been posted, but there are usually multiple ways to do the same thing, so I will post another possible answer (if I know of one). This gives the user more than one option, and they can choose what works best for them.