SubStr requires more than one parameter, just as the error states. Try...

Dim $aMatchIdx[] ; an arrary variable declared.
$aMatchIdx = AScan($aRecord, Substr($obj.name, 4),,,2)