Compile error thrown in "error free" code.

Discussion in 'Bug Reports' started by cyclotis04, May 24, 2011.

  1. cyclotis04

    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.

    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.
  2. klaus

    klaus Expert Licensed User

    I think that the problem is here:
    btn.Color = "0,0,0"

    Should be:
    btn.Color = RGB(0,0,0)

    Best regards.
  3. cyclotis04

    cyclotis04 New Member

    This does fix the error, but why doesn't Basic4ppc catch my mistake before trying to compile?
  4. agraham

    agraham Expert Licensed 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.
  5. Erel

    Erel Administrator Staff Member Licensed User

    @cyclotis04, please contact You appear as an unlicensed user for some reason.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice