Actually the code is correct, it's the example I gave that's wrong:

$con(5) returns 3 if the CID of the 5th Status is 3.
should be
$con(5) returns 3 if the CID of the 3rd Status is 5.

Using $gettok() would make it equivalent to $scon(N), ie pointless smile