[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: difference between


>
>
> I finally used the suggestion of Jussi
> If IsNull(PictureBoxQRCode.Image) = False Then
> that is more explicit (for me)
>
> Thank you all
>

Oops apologies for previous post i hit send before editing :-\

Was going to say how that has to be slower.
It;s essentially doing 2 tests, Isnull() tests if Image is null then =
False tests the result

the fastest test should simply be...
If PictureBoxQRCode.Image Then

I ran a simple test on a form that has no Me.Picture set...

Public Sub TestNow()
  Dim bBol As Integer
  For c As Integer = 0 To 100000
    If IsNull(Me.Picture) = False Then Inc bBol
  Next
End

Public Sub TestNow2()
  Dim bBol As Integer
  For c As Integer = 0 To 100000
    If Me.Picture Then Inc bBol
  Next
End

TestNow: 9,031
TestNow2: 7,355

Respects
BruceS

References:
difference betweenvalaquarus <valaquarus@xxxxxxxxx>
Re: difference betweenJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: difference betweenJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: difference betweenvalaquarus <valaquarus@xxxxxxxxx>