4.3.5 The NOVALUE condition
The NOVALUE condition is of internal origin. It is raised in some
circumstances if the value of an unset symbol (which is not a
constant symbol) is requested. Normally, this would return the
default value of the symbol. It is considered bad programming
practice not to initialize variables, and setting the NOVALUE
condition is one method of finding the parts of your program that
uses this programming practice.

Note however, there are only three instances where this condition
may be raised: that is when the value of an unset (non-constant)
symbol is used requested: in an expression; after the VAR
subkeyword in a PARSE clause; and as an indirect reference in
either a template, a DROP or a PROCEDURE clause. In particular,
this condition is not raised if the VALUE() or SYMBOL() built-in
functions refer to an unset symbol.

Differences between NOVALUE and the standard condition are:

·    It may only be trapped by method SIGNAL, never method CALL.
  This requirement might seem somewhat strange, but the idea is that
  since an implementation is only forced to check for conditions
  trapped by method CALL at clause boundaries, incidences that may
  occur at any point within clauses (like NOVALUE) can only be
  trapped by method SIGNAL. (However, condition NOTREADY can occur
  within a clause, and may be trapped by method CALL so this does
  not seem to be absolute consistent.)

·    There is not delay-action for condition NOVALUE, since it can
  not be trapped by method CALL, and consequently never can get into
  state DELAY.

The descriptive text returned by calling CONDITION() with the
Description option, is the derived (i.e. tail has be substituted
if possible) name of the variable that caused the condition to be
raised.



PREV NEXT