jaytea commented on a Page, $chr() List dialog  -  Oct 15, 2011

'waste of time'? Dean:

on *:dialog:chr:init:*:{
  var %x = 33
  while (%x < 255) { 
    if (%x !isnum 127-159) { did -a chr 1 %x | did -a chr 2 $chr(%x) }
    inc %x
  }
}

between %x = 127 and %x = 159, the loop does nothing except cycle unnecessarily. THAT is a waste of time, albeit a small one. this is what i meant:

on *:dialog:chr:init:*:{
  var %x = 33
  while (%x < 255) { 
    if (%x == 127) %x = 160
   did -a chr 1 %x | did -a chr 2 $chr(%x)
    inc %x
  }
}

the difference in execution time is so insignificantly small in this case that it really doesn't matter. but it is plain incorrect to say using 2 separate while loops is a 'waste of time' because it actually produces faster code. if you're not able to see this, consider that your method requires mIRC to perform an if statement for all 222 of its iterations, of which 33 are completely redundant.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.