If Source_Height > MinSize Then
If Source_Width > Source_Height Then
Scale_Factor = Source_Width / MinSize // '/': floating point division
Else
Scale_Factor = Source_Height / MinSize // '/': floating point division
End If
End If
In the debugger, the code runs until the first If line, then go directly to End Function and do not even return anything (a Picture, resized was meant to be returned).
MinSize was 200
Source_Height was 250
I got that fo years and ask y hair for my reaction.
Can you guess how many times I wasted before I discovers that ?
My doctor asks me if I am stressed, what can I say to her?
Yes, my blood pressure is high, yeah!
No later than yesterday, I got strange data Pasted from the Clipboard in a ListBox. Wrost: when I read my Clipboard contents, some parts of the pasted data comes from elsewhere because they are not in the Clipboard. The first line meant to be the Heading was wrong
Also I have a TabPanel wth two panels, the Canvas from Tab1 appears below everything in Tab2.
Internet was off, only Xojo was running. Oh, I know, blame Apple ! ts MacBook Pro dislike working so late at night.
If Source_Height > MinSize Then
If Source_Width > Source_Height Then
Scale_Factor = Source_Width / MinSize // '/': floating point division
Else
Scale_Factor = Source_Height / MinSize // '/': floating point division
End If
ELSE
' do something else
End If
Nothing wrong with those values, apart from the situation that Scale_Factor is then not set.
So if Scale_Factor was left as zero, and it was used to scale a picture, probably boom.
Scale_Factor = 1
If Source_Height > MinSize Then
If Source_Width > Source_Height Then
Scale_Factor = Source_Width / MinSize // '/': floating point division
Else
Scale_Factor = Source_Height / MinSize // '/': floating point division
End If
End If