Page 1 of 1

Function Naming

Posted: Thu Feb 04, 2016 6:46 pm
by olzeke51
Just ran across this while doing some beta testing: - used a fairly recent version of 'setupBasic.exe' - reports 9.36f also??!!
if the name of a function starts with a number -- the compiler errors out
'
Analyzing F:/Coridium/824_wifi/824max_fisher_01.bas
Programming Flash 0824...

function 5Key5(key)
-ERROR F:/Coridium/824_wifi/824max_fisher_01.bas: 143: Duplicate Name, found 5Key5(key)
'''
take the first '5' off and no more error
'
hooked up a BasicChip/board to verify - with ARMbasic 9.36f - ran the same program as above - it fails with a 5key5
'
'
Maybe update the SUB & Function description with a caution??

Re: Function Naming

Posted: Thu Feb 04, 2016 11:55 pm
by basicchip
That has never been legal, and is not in most languages including C and BASIC.

FUNCTIONS and SUB names follow the same rules for variables, must start with an alphabetic character, followed by alpha, number or _