The typical way I test where I need to differentiate between a 0 value and an error or null is this:
Code:
If (!value && value != 0)
'only runs on error
elseif (value == 0)
'only runs if value is explicitly 0
else
'etc
endif
You could also:
Code:
If (value == error)
'catches ALL errors, no matter the type
print(cstr(error));
elseif (!value)
'since error is trapped above, this would run on 0
else
'etc
endif