A parte l'indentatura per il resto ho ripettato la tua sequenza.
Perchè rscat("TESTO") non ha senso? che devo fare?