Mike,
The real problem here is that since i is not declared and it exists in the calling routine the called routine will reuse the same memvar, which will cause the called routine to stomp on the value of the variable of it's caller.
Declaring it PRIVATE or LOCAL,
LOCAL is much better will cause the routine to get it's own version of i.
>Hi Mark,
>
>>If you declare i, entries, aremdirs as private it works.
>
>Variables are automatically declared Private. Do you mean Local?