You are correct. Upon further pondering I realized that the number of
iterations that my loop was making was actually zero. In this case the
output terminal for the refnum had no data. It was not the runtime
that caused the problem but rather the lack of any iterations through
the loop that made my refnum invalid. This is a subtle but easy to
make programming error. Never depend on the output terminal of a for
loop if the for loop can iterate zero times.
Sorry for the false alarm and thanks for checking this for me.