Thanks for your help.

Doing this fixed it for me.

$aMatchIdx = AScan($aRecord, Substr(($obj.name), 4, 100),,,2)