Menu

Can't Compile Char Data Type

KW Yan
2009-11-20
2013-04-25
  • KW Yan

    KW Yan - 2009-11-20

    program Map;

       function FmtImgName (ALvl : integer) : string;
       var
          Lvl : char;
       begin
          if ALvl <= 1 then
             **Lvl := '1'** { <== line 8 }
          else
             **Lvl := '2';** { <== line 10 }
          FmtImgName := '/' + Lvl + '/';
       end;

    begin
       DrawText (FmtImgName(1), 0, 0);
       repaint;
       delay (1000);
    end.

    Compiling '../../MapSrc/Map.E4C9FFF5'…
    ../../MapSrc/Map.E4C9FFF5:8: error, left and right operands to ':=' must have the same type
    ../../MapSrc/Map.E4C9FFF5:10: error, left and right operands to ':=' must have the same type
    Done - 2 error(s), 0 warning(s)

     
  • Javier Santo Domingo

    Thanks for your report.

    This bug was produced by a little mistake in the Artem's new lexer implementation, it was not recognizing literal chars and even accepting empty literals.

    I've fixed it, and this fix will be included in an ALPHA 2 version i'm working on right now, with many other fixes also.

     
  • KW Yan

    KW Yan - 2009-11-23

    Tested and confirmed it is fixed in 3.0 Alpha 2.

     

Log in to post a comment.