Hi guys, I'm trying to put together a piece of code that will take a user entry (a number from 1-65535). I want to have it in both string and int formats and be able to pick out all the invalid entries.
What I wrote below pretty much does what I need it to do, with one exception: the output is correct only when I enter a correct number at the first attempt. If, for instance I make 3 consecutive entries: 1. dskj8e8, 2. 8a8, 3. 12345, the output product will not be "12345" but "123451234512345". As you can see, I'm trying to reset the variable each time the entry is incorrect, but not doing it right, I guess. What is the best way to go about this?