Function Naming

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Function Naming

Post 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??



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Function Naming

Post 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 _

Post Reply