get_recursive_index function

Obtain an index to extract out a sub-call