It was a faulty (internal) **FUNCTION IsNumberEx(a$)** that was the culprit.

I rewrote that function today in an easier to understand manner. Not only does that function serve to identify whether its argument is an integer, floating point, or scientific notation but I learned (the hard way) that it's also used to validate SUB and FUNCTION names.

My new version doesn't guarantee, for example, that a scientific notation number is absolutely valid, only that its characters and their counts appear to conform to the general rules of what a SN should be. I'm still testing all the changes but it's all looking pretty swell at this moment.

`FUNCTION IsNumberEx (a$)`

DIM RAW i,HasDigit, HasE, HasMinus, HasPlus, HasDecimal, HasInvalid

i = HasDigit = HasE = HasMinus = HasPlus = HasDecimal = 0

IF NOT *a THEN EXIT FUNCTION ' Handle null argument

'***********************************************************

' Rules of scientific notation:

' The base is always 10

' The exponent is a non-zero integer

' The ABS value of the coefficient is >=1 and <10

' The coefficient carries the sign (+ or -)

' The mantissa carries the significant digits

' Rules for this function

' Can only have these characters: -+.0123456789eE

' Must have at least 1 digit

' Only 1 "E" (case doesn't matter)

' No more than 2 plus signs

' No more than 2 minus signs

' No more than 1 decimal point

'***********************************************************

WHILE a[i]

HasInvalid = 1 ' Assume every char is INVALID

IF (a[i]>47 AND a[i]<59) THEN

INCR HasDigit ' 0123456789

HasInvalid = 0

END IF

IF a[i]=43 THEN

INCR HasPlus ' +

HasInvalid = 0

END IF

IF a[i]=45 THEN

INCR HasMinus ' -

HasInvalid = 0

END IF

IF a[i]=46 THEN

INCR HasDecimal ' .

HasInvalid = 0

END IF

IF (a[i]=69 OR a[i]=101) THEN

INCR HasE ' e or E

HasInvalid = 0

END IF

IF HasInvalid THEN EXIT FUNCTION

i++

WEND

FUNCTION = (HasDigit > 0) AND (HasE <2) AND (HasPlus <3) AND (HasMinus <3) AND (HasDecimal <2)

END FUNCTION ' IsNumberEx