Re: Dumb Question

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ben Bangham (ben.bangham_at_britishcouncil.org)
Date: 08/18/04


Date: 18 Aug 2004 08:37:30 -0700


"Angelo Campitelli" <campitellian@sac.qld.edu.au> wrote in message news:<OnpiVBNhEHA.2620@TK2MSFTNGP10.phx.gbl>...
> Dumb question but with vb script how can i check if colItems contains any
> results?
>
> ive tied isCollection, isNothing and isEmpty none seem to return true/false
> if results are returned
>

[snip code]

you want to compare your object reference to the built-in object 'nothing':

if colItems is nothing then wscript.echo "No such drive"

...I suppose this is the vbscript equivilant to comparing a pointer to NULL in C...

HTH,

Ben.



Relevant Pages

  • Re: Dumb Question
    ... For Each objItem in colItems ... "Ben Bangham" wrote in message ... > you want to compare your object reference to the built-in object ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI Collection question
    ... > Dumb question but with vb script how can i check if colItems contains any ... > ive tied isCollection, isNothing and isEmpty none seem to return ...
    (microsoft.public.windows.server.scripting)
  • Dumb Question
    ... Dumb question but with vb script how can i check if colItems contains any ... isNothing and isEmpty none seem to return true/false ...
    (microsoft.public.win32.programmer.wmi)
  • WMI Collection question
    ... Dumb question but with vb script how can i check if colItems contains any ... isNothing and isEmpty none seem to return true/false ...
    (microsoft.public.windows.server.scripting)