Heh, touche.
While I do appreciate solid bounds checking as much as the next guy... I looked at his problem and sought a simple solution that best suited it.
Taking into consideration that this is user input, it would probably be best to handle it a little more securely in order to prevent someone from entering strings that might grant them access to other files or directories. So in practice, I would probably go with a regular expression myself to confirm the input is valid. But in building that number, I'd probably still use one of the 3 methods I posted.
... On third thought, I'd probably use this instead.
var %n = $$1
if ( %n isnum 1-9 ) %n = 0 $+ %n
elseif ( %n !isnum 10-12 ) return
dcc send $nick %n $+ .log
- Raccoon
The possibilities are infinite.