B
BillE
VS2008 VB.NET
While debugging code recently I found that in some cases both parts of an
If-Then-Else statement were executing.
For example:
dim bl as boolean = false
dim i as integer
if bl then
i=1
else
i=2
end if
While stepping through the code, first the i=1 would execute then the i=2
would execute. I resorted to
if bl then
i=1
end if
if not bl then
i=2
end if
I wonder how this could happen?
Thanks
Bill
While debugging code recently I found that in some cases both parts of an
If-Then-Else statement were executing.
For example:
dim bl as boolean = false
dim i as integer
if bl then
i=1
else
i=2
end if
While stepping through the code, first the i=1 would execute then the i=2
would execute. I resorted to
if bl then
i=1
end if
if not bl then
i=2
end if
I wonder how this could happen?
Thanks
Bill