....era tutto giusto, solo che i cicli for sforavano.... anzichè

Codice PHP:
To elementi.Count 
andava

Codice PHP:
To elementi.Count