Compile error thrown in "error free" code.

cyclotis04

New Member
I can successfully Run and Build my code, and Basic4ppc tells me that there are no errors. When I try to compile to any executable, however, I get a compile error "CS1026: ) expected" on line 171.

B4X:
168 Sub MySub
169   If bln Then
170     lst.Focus
171     btn.Color = "0,0,0"
172     '...
173   Else
174     '...
175   End If
176 End Sub

What is wrong? I'm posting this as a bug, rather than help request, because Basic4ppc should not tell me there are no errors when I build it, then turn around and throw a compile error at me.
 

agraham

Expert
Licensed User
Longtime User
I think it may be a backwards compatibility issue from long ago. I seem to remember Erel saying that that btn.Color = "0,0,0" was valid in very early versions of Basic4ppc in the IDE before the true compiler was introduced. Indeed you should see that when you run your program in the IDE the button has a black border that vanishes if you comment out that line. It looks like the IDE still accepts the syntax, but doesn't do the right thing with it anymore, while the code generator for the optimising compiler doesn't support this deprecated syntax at all.
 
Top