bas7ener.hlp (Topic list)
DEF FN not allowed in control statements
DEF FN function definitions are not permitted inside control
constructs such as IF...THEN...ELSE and  SELECT CASE.