Perhaps you can change this:
while (%a <= %z) {
in to:
while (%a %z) {
otherwise it will not return the last line of the ini (Last rule in this script)