Called Selection Fails

Trying to help someone troubleshoot a failing procedure I’ve come across a scenario that makes no sense to me so far.

He has a procedure that calls another and ends with all records selected - which is wrong.

RemoveAllSummaries
SelectAll
Field Date SortUp
Field Name GroupUp
Field “BalDue” FormulaFill Fee-Paid
Field “BalDue” RunningTotal
Call “.find owed”

.find owed:

Local lvOwes
arrayselectedbuild lvOwes,¶,"",?(info(“Summary”) = 1 and BalDue ≠ 0,Name,"")
Clipboard = lvOwes
Select arraycontains(lvOwes,Name,¶)
OutLineLevel “1”

The Clipboard (which I’ve added for feedback) shows the correct list of names, but that’s not what it selects. BUT, if I combine the two procedures, eliminating the call, it works without fail:

RemoveAllSummaries
SelectAll
Field Date SortUp
Field Name GroupUp
Field “BalDue” FormulaFill Fee-Paid
Field “BalDue” RunningTotal
Local lvOwes
arrayselectedbuild lvOwes,¶,"",?(info(“Summary”) = 1 and BalDue ≠ 0,Name,"")
Clipboard = lvOwes
Select arraycontains(lvOwes,Name,¶)
OutLineLevel “1”

I can also run just the called procedure after a failure and then it makes the correct selection. There are no values being passed from one to the other, no other databases being involved so why would the selection fail only if called?

There is no reason why a call statement should affect what is selected. I don’t see what is causing this. I’m taking your word for it that lvOwes does in fact contain the correct values. If it is possible to send me a database that demonstrates this behavior I will see if I can track this down, but just looking at the code it seems like it should be ok.

I’ll put together a diminished copy of the db to make it easier for you to deal with it.