Shouldn't the compiler react to this?:
Code: Select all
#S_OK=0
Code: Select all
x=#S_OK
#S_OK=0
Code: Select all
#S_OK=2
I'm not saying the current way is wrong, I'd just like some warning or notification so I can get rid of a whole bunch of unneeded constant defines. (over time as constants are added to PB, old sources tend to get redundant constant defines obviously)
Maybe the compiler could do redundancy warnings if EnableExplicit is used?
*scratches head*
Structures, Interfaces, and Prototypes on the other hand seems to have these checks.
But functions are worse off, like this example:
Code: Select all
MessageBox_(#Null,"Test","Hmm!",#Null)
Procedure MessageBox_(text$,title$)
Debug "Now this is just silly! And potentially dangerous!"
Debug title$+" "+text$
EndProcedure
MessageBox_("Test2","Oops?")