On up-to-date systems, you will find the new proc
template::list::get_rowcount
Giving the proper count of the number of records retrieved by a template::list
Thanks to Gustaf for his suggestions on this!
All the best