calling an object that doesn't exist

BlitzMax Forums/BlitzMax Beginners Area/calling an object that doesn't exist

mudcat(Posted 2005) [#1]
if I call an object that doesn't exist,I'll get an error,how do you check that there is an object bwefore calling on it?

thanks,
mudcat


Azathoth(Posted 2005) [#2]
Check if its null?


mudcat(Posted 2005) [#3]
how?
if trock.create()<>null?


Koriolis(Posted 2005) [#4]
You don't "call an object". You call a method on a given object. Which fails if the object is null.

how?
if trock.create()<>null?
No, like this
if myobject<>null then...



Tiger(Posted 2005) [#5]
In your case,
If trock<>Null Then...



mudcat(Posted 2005) [#6]
Thanks all,
I am getting the hang of it,with everyones help.

mudcat