Campbell Ritchie wrote:I suggest you stop at this point and consider what you are doing.
My, my. Agreeing with Campbell twice in two days; must be a record...
@Thomas: ...but he's absolutely right:
StopCoding (←click). In fact,
whenever you run into difficulties you should get into the habit of doing it.
He's also right about your repeated code. Good programmers share a common trait: they
hate typing - or at least, they hate typing
the same thing more than once. I've been programming for 35 years, and I still only use two fingers.
And copy/paste is NOT the solution. Indeed, I wish more IDEs would disable the function in their source editors.
Tip: Whenever you find yourself typing the same thing more than once, you should ask yourself: How can I put this in a method (or, as he suggests, a class)?
Winston