Testing and Debugging

George

Member
Joined
Jun 2, 2005
Messages
11
Programming Experience
Beginner
Hi there everbody,
I was wondering if anyone could tell me what the answer to this question is......? I have been battling for ages and just can't work it out....a,b,c,d or e?

Dim I1 As Integer
Dim D1 As Double
Dim dte As Date

Try
dte = #4/1/2002#
I1 = dte.AddSeconds(-0.75).Day
D1 = I1 / (I1 - 1)
Exit Try
I1 = I1 * 2
Catch
I1 = 1000
Finally
Debug.WriteLine("I1 = " & I1)
End Try

What is the output from this code sample?

a. I1 = 62

b. I1 = 2

c. I1 = 1000

d. I1 = 31

e. No output will be generated by this code sample.
 
If this is homework then I suggest that you do it yourself. If it's not then just run it in the debugger and see. If you want help to work out how to work it out yourself, then you've come to the right place. Obviously, you just need to take it one line at a time and work out what that line does. Which is the first line that you don't understand?
 
Hi there,

No it wasn't homework, just a quiz going round the office, unfortunately I don't have visual studio installed so couldn't just run it. I have since figured it out though. Thanks for your reply anyway.

Regards
George
 
Back
Top