J
Jerry West
I have a 'variable not declared' error occurring when in fact the var is
declared --its just nested in a If Then statement. Like so:
If bPortrait Then
'then its in portrait mode
' Make a bitmap for the result.
Dim bm_dest As New Bitmap(CInt(bm_source.Height *
scale_factor), CInt(bm_source.Width * scale_factor))
Else
'then it's in landscape mode
' Make a bitmap for the result.
Dim bm_dest As New Bitmap(CInt(bm_source.Width *
scale_factor), CInt(bm_source.Height * scale_factor))
End If
Why do I get this error when either way the If Then clause falls the var is
declared and will execute? I understand that I can set the If Then clause
for the height & width values and then declare the var outside of that. But
why doesn't the above --which is functionally equivalent-- work?
JW
declared --its just nested in a If Then statement. Like so:
If bPortrait Then
'then its in portrait mode
' Make a bitmap for the result.
Dim bm_dest As New Bitmap(CInt(bm_source.Height *
scale_factor), CInt(bm_source.Width * scale_factor))
Else
'then it's in landscape mode
' Make a bitmap for the result.
Dim bm_dest As New Bitmap(CInt(bm_source.Width *
scale_factor), CInt(bm_source.Height * scale_factor))
End If
Why do I get this error when either way the If Then clause falls the var is
declared and will execute? I understand that I can set the If Then clause
for the height & width values and then declare the var outside of that. But
why doesn't the above --which is functionally equivalent-- work?
JW