This is the most ridiculous question I've seen you ask out of the many you've posted over the years on this message board, and is the last time I'm going to help you because you clearly don't even bother trying to figure out the problem before running to us.

$chr(48) = 0, so when you do $gettok($did(3).sel,1,48), you get the first token separated by 0. This means that in 30, $gettok(30,1,48) will be 3. Remove the $gettok and just use $did(3).sel instead.