<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- generator="HardwareAnalysis.Com" -->
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="">
        <title>Hardware Analysis - Visual Basic: How do I check whether an Object exists?</title>
        <description>Hardware Analysis Community Forums</description>
        <link>http://www.hardwareanalysis.com/content/topic/50390/</link>
        <image rdf:resource="http://media.hardwareanalysis.com/halogo.gif" />
       <dc:date>2008-08-29T15:06:04-05:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533235"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533233"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533229"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533228"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533227"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533226"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338717"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338714"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338626"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338624"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338623"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338618"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338617"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338615"/>
                <rdf:li rdf:resource="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338611"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://media.hardwareanalysis.com/halogo.gif">
        <title>Hardware Analysis</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/</link>
        <url>http://media.hardwareanalysis.com/halogo.gif</url>
    </image>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533235">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T15:19:59-05:00</dc:date>
        <dc:creator>Dragon Peaceful</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533235</link>
        <description>WTF?  Someone fell in a time worm hole?&lt;br /&gt;
</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533233">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T15:09:48-05:00</dc:date>
        <dc:creator>FordGT90Concept</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533233</link>
        <description>Not so drugged... When I read &amp;quot;SymbolBlock&amp;quot; I anticipated that it had something to do with symbolic linking in DLLs.  How it is worded suggests that it is a variable that is/points to a class or struct of sorts.  Basically, &amp;quot;If Not SymbolBlock Is Nothing Then&amp;quot; is checking if there is an instance associated with &amp;quot;SymbolBlock.&amp;quot;  It is simply checking the memory pointer to see if it points to a valid object or to nothing (aka &amp;quot;null&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
I think the error produced is kind of awkward which lead to confusion.  The error certainly isn't the typical &amp;quot;Object not set to reference blah blah&amp;quot; error message--it looks like a custom jobbie in an external application.&lt;br /&gt;
&lt;br /&gt;
Additionally, &amp;quot;Is&amp;quot; is dedicated to checking for null values (type comparisons).  &amp;quot;=&amp;quot; checks for equality which, in the way VB is, something can never equal nothing.  &amp;quot;Is&amp;quot; works around that shortcoming in &amp;quot;=&amp;quot; ... other languages often handle things a little differently so a check for equality in one language might not garner the same results in another language.  They all seem to have their perks.&lt;br /&gt;
&lt;br /&gt;
So, um, yeah.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For your information, Sally, guruShane was banned from this site some time ago.  No further comment on that subject from me. &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile10.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:X&quot; title=&quot;:X&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533229">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T13:44:31-05:00</dc:date>
        <dc:creator>FordGT90Concept</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533229</link>
        <description>Aw, you got my rusty old VB gears turning for nothing. &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile2.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:(&quot; title=&quot;:(&quot;&gt;  I hope they still work for when they are needed. *headache follows* XD  Can you throw this old dog a bone?  Me likes puzzles. &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile1.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:)&quot; title=&quot;:)&quot;&gt;  One is also on drugs so don't mind me &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile8.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:_)&quot; title=&quot;:_)&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533228">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T13:38:14-05:00</dc:date>
        <dc:creator>Rhort</dc:creator>
        <title>.</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533228</link>
        <description>Big Beavis said: &lt;div class=&quot;quote&quot;&gt;Sally Lorren said: &lt;div class=&quot;quote&quot;&gt;I think you are *both* acting like Kids (thats an insult to kids tbh). Flaming and USING CAPS UNNECESSARILY. You have tarnished this site for me. I wont be visiting again.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Oh no! Offended by a three year old post, instigated by a former member who is now on permanent vacation from the site! Seriously, find some newer posts to offend you if you want to go that route &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile1.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:)&quot; title=&quot;:)&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
LOL  That was her first post too! &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile3.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:D&quot; title=&quot;:D&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533227">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T13:05:05-05:00</dc:date>
        <dc:creator>Beavis Khan</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533227</link>
        <description>Sally Lorren said: &lt;div class=&quot;quote&quot;&gt;I think you are *both* acting like Kids (thats an insult to kids tbh). Flaming and USING CAPS UNNECESSARILY. You have tarnished this site for me. I wont be visiting again.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Oh no! Offended by a three year old post, instigated by a former member who is now on permanent vacation from the site! Seriously, find some newer posts to offend you if you want to go that route &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile1.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:)&quot; title=&quot;:)&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#533226">
        <dc:format>text/html</dc:format>
        <dc:date>2008-04-10T12:59:14-05:00</dc:date>
        <dc:creator>Sally Lorren</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#533226</link>
        <description>I think you are *both* acting like Kids (thats an insult to kids tbh). Flaming and USING CAPS UNNECESSARILY. You have tarnished this site for me. I wont be visiting again.</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338717">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T22:52:45-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338717</link>
        <description>You're probably right.  It might raise an exception.  You could always use a Try/Catch with it and that would get you the same results, but it is faster and easier just to use the other version, unless, of course, you are already using a Try/Catch.&lt;br /&gt;
&lt;br /&gt;
Can you create Custom exceptions with VB?  The more limitations I see, the less I like Visual Basic.&lt;br /&gt;
&lt;br /&gt;
lol and don't worry about any lack of VB skill.  From the looks of its shortcomings, VB kind of sucks.</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338714">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T22:42:01-05:00</dc:date>
        <dc:creator>Sandy</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338714</link>
        <description>Chill, it works, and this is good.&lt;br /&gt;
&lt;br /&gt;
I'm not really sure why the error was really generated in the first place, as the function concerned is an event handler, and should give you a reference to the block that was selected.  I assumed that the reason for the error was a poorly written Object model (Mentor Graphics DxDesigner if you care) - with an event handler that doesn't check whether it has valid arguments whenever it's called.  The question was only asking about a workaround, which i failed only to implement because of an embarassing lack of VB skill.&lt;br /&gt;
&lt;br /&gt;
Incidentally Blue, i'm not sure the code you suggested would work, as it the object variable would have to be initalised for you to test equality to something other than nothing.</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338626">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T19:21:57-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338626</link>
        <description>This was written:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;If Not SymbolBlock Is Nothing Then&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can substitute this:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;If SymbolBlock Is ________ Then&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All you would have to do is test for what has been assigned.  Insert the value being tested for in place of the underline, (lol before someone flames me and tells me that the underline isn't proper code...)</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338624">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T19:18:13-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338624</link>
        <description>&amp;quot;Also where an object does not exist at a certain time, it may be necessary to create it.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It looks as if it must have been unclear to you then.  If you would have read my post PROPERLY, you wouldn't have been confused as to what I was trying to explain.&lt;br /&gt;
&lt;br /&gt;
I think it's hilarious that I proved the professional that has been doing it for 7 years WRONG.  LMAO&lt;br /&gt;
Good riddance.  &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile5.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;:P&quot; title=&quot;:P&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338623">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T19:12:16-05:00</dc:date>
        <dc:creator>Ex Member</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338623</link>
        <description>If you read the first post properly you will see that what is really being asked is: &lt;br /&gt;
&lt;br /&gt;
How do test that the object variable that I have declared is currently referencing an instantiated object? &lt;br /&gt;
&lt;br /&gt;
I think it is pretty clear what was asked and that's why this thread was cleared up in 3 posts. &lt;br /&gt;
&lt;br /&gt;
I criticised your post because I felt it uneccessarily confused what was actually a very straightforward question. Furthermore, I am not going to argue semantics any further as you seem to me to be the sort of person who won't give it up until you feel you have proved me wrong. Feel free to pick more holes in anything I have posted. I don't care as I will not be reading any further. Goodbye</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338618">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T18:56:25-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338618</link>
        <description>Oh, I almost forgot.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Just because code is executing in the same scope as an object variable, does not mean the object variable has been instantiated. Is Nothing is an object variable instantiation test, not an existence test.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Considering that the title of this thread is, &amp;quot;Visual Basic: How do I check whether an Object exists?&amp;quot;, then you should realize why I mentioned the scope.  If there is a question as to whether the object EXISTS, that would primarily be a variable scope issue, would it not there Mr. Professional???  Hmmm?</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338617">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T18:52:27-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338617</link>
        <description>&amp;quot;You can test to see if it contains what it is supposed to contain, you can set up an If statement or a select statement that will test to see if it has been assigned to a value.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
THIS IS 100% RIGHT!  If you were such a professional that has been doing this for 7 years, you should have pointed that out as being right.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Wrong.&lt;br /&gt;
&lt;br /&gt;
Just because code is executing in the same scope as an object variable, does not mean the object variable has been instantiated. Is Nothing is an object variable instantiation test, not an existence test.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Thank you for clearing that up for the person that didn't understand...  LMAO  I totally understand, so you must be telling someone else.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;If by your own admission you don't know VB, why are you so vocal in trying to educate those of us who have been using it professionally for over 7 years?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I didn't say that I didn't know VB.  I said that I wasn't as good with it as I was with C#.  There is a HUGE difference.  Considering that I just composed an e-mail program with VB, I would tend to think that is FAR from not knowing VB...&lt;br /&gt;
&lt;br /&gt;
Since the question was answered already, why do you feel the need to point out things that are wrong that AREN'T wrong, as well as things that are wrong THAT I ALREADY MENTIONED MIGHT BE???  I know many languages, forgive me for getting them confused at times.  &lt;img src=&quot;http://media.hardwareanalysis.com/smilies/smile4.gif&quot; width=&quot;14&quot; height=&quot;14&quot; border=&quot;0&quot; alt=&quot;;)&quot; title=&quot;;)&quot;&gt;</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338615">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T18:27:08-05:00</dc:date>
        <dc:creator>Ex Member</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338615</link>
        <description>Wrong.&lt;br /&gt;
&lt;br /&gt;
Just because code is executing in the same scope as an object variable, does not mean the object variable has been instantiated. Is Nothing is an object variable instantiation test, not an existence test.&lt;br /&gt;
&lt;br /&gt;
Wrong.&lt;br /&gt;
&lt;br /&gt;
This is VB.  ==  is the operator for equality testing in C and Java syntax. &amp;quot;Is&amp;quot; is the correct operator to use in this situation.&lt;br /&gt;
&lt;br /&gt;
The question was answered correctly in the first place. The program now works. Everybody is happy. If by your own admission you don't know VB, why are you so vocal in trying to educate those of us who have been using it professionally for over 7 years?&lt;br /&gt;
</description>
    </item>
    <item rdf:about="http://www.hardwareanalysis.com/content/topic/50390/?l=1#338611">
        <dc:format>text/html</dc:format>
        <dc:date>2005-10-19T18:09:06-05:00</dc:date>
        <dc:creator>guru Shane</dc:creator>
        <title>Re: Visual Basic: How do I check whether an Object exists?</title>
        <link>http://www.hardwareanalysis.com/content/topic/50390/?l=1#338611</link>
        <description>Well, if you are within the same scope as the variable itself, it will exist.  You can test to see if it contains what it is supposed to contain, you can set up an If statement or a select statement that will test to see if it has been assigned to a value.  While you are testing to see if it is equal to nothing, you could also test to see if it is equal to something.  I'm not sure, (as I'm not nearly as good with VB as with C#), but your statement might have originally worked if you had use two equals signs.  Whenever making a comparison, you use ==.  If you only use 1 = sign, then it will try to assign the value on the right side of it to what's on the left side of it.</description>
    </item>
</rdf:RDF>
