@fender Please show your code where you're trying to show dialog and print, else nobody will be able to tell you what is wrong.
Also, this for loop and switch() are weird. Why do you iterate over 0..11 if your max value is 10?