?
Solved

VB2008 How to check for a Null Bitmap in an Array

Posted on 2009-04-23
4
Medium Priority
?
412 Views
Last Modified: 2013-11-27
I have an array of type bitmap and I want to check if an element is empty or not. Something like:

Dim FlagBitmap(8) As Bitmap
...
If FlagBitmap(RandomInteger) = DBNull.Value Then

But I keep getting an error because zero or null cannot be used with = with a bitmap. Can anyone help?
0
Comment
Question by:onewheelhk
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24222449
Can you try this
if FlagBitmap(RandomInteger) = Null
0
 
LVL 48

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 2000 total points
ID: 24222528
If FlagBitmap(RandomInteger) Is Nothing Then

Wayne
0
 
LVL 2

Expert Comment

by:clinton_cunningham
ID: 24222579
IsNothing: Example

Public Sub test()
    Dim o As Bitmap

    If IsNothing(O) Then
        Debugger.Break()
    End If
End Sub
0
 
LVL 1

Author Comment

by:onewheelhk
ID: 24223347
I tried

If FlagBitmap(RandomInteger) = Null  

Error says Null constant is no longer supported

I've just tried

If FlagBitmap(RandomInteger) Is Nothing

and that seems to work. Excellent. Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question