Treatment of exceptions of an Inputbox

Asked

Viewed 41 times

0

I am doing an academic work where I have to pick up a data typed by the User and I am using a Inputbox for such.

But the Inputbox displays several mistakes which I am not aware of.

by clicking Cancel displays the following error:

inserir a descrição da imagem aqui

Error: inserir a descrição da imagem aqui

Other error that I’m trying to deal with is by clicking on (X) of Inputbox

inserir a descrição da imagem aqui

Error: inserir a descrição da imagem aqui

How can I deal with these mistakes? Or if you have other tips from best forms to get that input User would also like to know.

Thank you.

  • What makes the line wrong?

  • Takes input typed by user valueRetorando = Inputbox(Prompt, Title, answerPadrao, Xpos, Ypos)

  • By the image that posted the error is on the line where converts the entered value to integer.

  • even typing an Integer value, by clicking: cancel or (x) it displays the error.

  • Error informs that typed value(text) cannot be converted to integer.

  • 2

    Do not treat the symptom, treat the disease. When there is an error in the code you fix it and do not try to circumvent it.

  • I managed to fix by the link that Voce tagged @Maniero, I made a Try catch, Thanks.

  • If made a try-catchdid nothing of what was in links that I passed and did the opposite of what I commented above, treated the symptom, the disease remains there.

  • I didn’t understand, what would be the "disease"?

  • @Arthurluiz didn’t understand why he didn’t read the links that I went through.

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.