Results 1 to 6 of 6

Thread: How to check if a object is nothing with usage of a index [resolved]

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    How to check if a object is nothing with usage of a index [resolved]

    I have a program that supports plugins , now i want to create a nice plugin system that checks which of the objects is in use when one is nothing it should use that object variable , its name is MyPlug , it is devined as :

    Private MyPlug(99) As Object

    how can i check if it is nothing? :S
    Last edited by Ultimasnake; Oct 22nd, 2002 at 05:26 PM.
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    for i = 0 to 99
    if myplugin(i) is nothing then
    'whatver
    end if
    next i

    personally i thnk you should use a collection instead.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    yeah that works m8 , wondering why

    if myplug(i) = nothing doesnt work , isnt "is" and = the same? if not for what do i use each
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Is is one of those things that only gets used in like 3 situations. The only times I know if to use Is instead of = is...
    VB Code:
    1. If TypeOf control Is Textbox Then '...
    2.  
    3. If SomeVar Is Nothing Then '...
    4.  
    5. If SomeVar Is Null Then '...

    Any other time you use =, unless I missed one.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    aha... ok i have learned form this :P yeah thanks m8's
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Rule of thumb:
    If it's an object, use "Is".
    If dealing with a value (objects don't have value, they either exist, or they don't) then us "="
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width