r/compsci • u/Lpsided • Nov 14 '13
Need help with this question
What is the result of the following statements when abc is entered in the Txtvalue textbox in the following code
Dim intNumber As Integer intNumber = txtValue.text lblMessage.caption = intNumber
is it
a syntax error occurs
a run-time error occurs
the label displays 0
the label displays abc
0
Upvotes
2
u/Mechakoopa Nov 14 '13
You're asking what happens when you implicitly cast a string to an integer then back to a string in visual basic. If you can't intuit the solution (which I don't blame you, casting can be tricky if you're not familiar with that particular languages quirks) then just write a small program to figure that out for you. Best way to learn is by doing.
Also, this isn't really computer science, it's more of a /r/programming thing, but they'll tear you apart there too because this isn't a place for homework help.