I want to declare a number of pointer variables. So normally I would write somthing like this.
Button *First;
Button *Prev;
Button *Next;
Button *Last;
This works just fine. But being the lazy sort I am, I sometimes will put it all on one line like this.
Button *First, *Prev, *Next, *Last;
But the compiler throws the following error when it's written that way.
Failed to save room room0.crm; details below
BluBox.ash(255): Error (line 255): '*' is already defined
--------------------- BluBox.ash -----------------------------------
255: Button *First, *Prev, *Next, *Last;
One other thing I noticed is that when it's written as shown below it apparently works just fine. There are no compiler errors and I am able to use the Prev, Next, and Last variables as I would any other pointer variable. It's as if the first"*" is applied to subsequent variables defined on the same line.
Button *First, Prev, Next, Last;
This doesn't seem to be correct to me.
It shouldn't really work that way, and I think long single line declarations have been discussed before as confusing the compiler's parser.
Fair enough, didn't know it was known. ;)
Well, it's not consistent with other languages like C, but really my plan would be to scrap the * altogether, since there's really no need for it with the "managed" designation for pointer structs.