...is
if (rindex > 0 && rindex <= 6)
in my sources.

Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,
National University of Ireland, Maynooth