TYPE properties and Function labels conflict

Previous topic - Next topic

AndyH

Put this code in

Code (glbasic) Select
TYPE test
typaa
ENDTYPE
Notice the lower case aa.

Now add this code, notice the upper case AA:

Code (glbasic) Select
FUNCTION typAA:

ENDFUNCTION
.

and the typaa in the TYPE changes blue (or the colour of your functions in the editor) and is now typAA and your code will not compile.

Same happens if you just enter typAA: for a label.

bigsofty

Even in a different case, disallowing a type name to be the same as a function name, might  not be such a bad thing?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

AndyH

Yea, I guess it is not good practice to have type or variable names the same as labels or function names, but GLB is case sensitive so it shouldn't conflict in this case - it's the editor that's doing it.

Easy solution is to make sure you use unique names for everything as you say. :)