like I said to you in IM.
leave the first entry of the array empty.
this way you can check simply if ascan() and then:

$Char = $Chars[iif(-1<$AltAPos,$AltAPos,0)]

well, there is other ways too...
anyway, the code looks too long still [Razz]
_________________________
!

download KiXnet