Error Messages/40206

< Error Messages
Revision as of 17:28, 9 January 2013 by Lchrisman (talk | contribs) (Created page with "= Warning Message = :The expression evaluation is attempting to use the "else" result from an IF-THEN construct that does not have an ELSE clause. = Cause = Co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Warning Message

The expression evaluation is attempting to use the "else" result from an IF-THEN construct that does not have an ELSE clause.

Cause

Consider this definition of a variable

If Population<100K Then 'Small'

When this is evaluated and there is a municipality with 100K or more people, there is no value provided by the expression, and thus, this warning results. If the warning is ignored, the value will be Null. In a case like this, you should stop the evaluation and add an Else clause, even if you want the result to be Null, e.g.

If Population<100K Then 'Small' Else Null

The appropriate time to omit the Else clause is when the result value is going to be ignored no matter what. For example,

If Area=0 Then MsgBox("x=0 was encountered");
Population/Area

See Also

Comments


You are not allowed to post comments.