Ok, I will be assuming you are using these words for the parts of an ini (I honestly don't know what the official terms are for each section):
[Topic]
Section=Item
Number of "topics":
//echo -a $ini(file.ini,0)
Number of "sections" within a specific "topic":
//echo -a $ini(file.ini,Topic,0)
These will give you the number of sections/topics in your file. If you need more than that, just ask.
*EDIT*
Are you trying to list out the "sections"? Or are you trying to output the last "section"?