Mi dà errore...

con questa funzione (get_next_value)