|
-
Oct 22nd, 2002, 04:19 PM
#1
Thread Starter
Frenzied Member
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.
-
Oct 22nd, 2002, 04:25 PM
#2
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.
-
Oct 22nd, 2002, 05:17 PM
#3
Thread Starter
Frenzied Member
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
-
Oct 22nd, 2002, 05:24 PM
#4
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:
If TypeOf control Is Textbox Then '...
If SomeVar Is Nothing Then '...
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
-
Oct 22nd, 2002, 05:26 PM
#5
Thread Starter
Frenzied Member
aha... ok i have learned form this :P yeah thanks m8's
-
Oct 22nd, 2002, 05:26 PM
#6
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 "="
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|