t-edson / PicPas

Compilador en Pascal para microcontroladores PIC / Pascal compiler for PIC microcontrollers
GNU General Public License v2.0
88 stars 27 forks source link

Error example LCD_Test.pas #34

Closed moonrockets closed 6 years ago

moonrockets commented 6 years ago

Last few lines of example LCD_Test.pas

until Counter = 0;

LcdCommand(LCD_CLEAR_DISPLAY);

end; end. ///*****//174

not working this from source-github....

LcdCommand(LCD_CLEAR_DISPLAY);

end; end; <======= * this inserted, compilation succesfull .... end. ///*****//174

only the END; inserted and compilation successfull -- any idea why?

moonrockets commented 6 years ago

failed: //////////////////////////////////////////// // New program created in 22.01.2018} //////////////////////////////////////////// program NewProgram; {$PROCESSOR PIC12F629} {$FREQUENCY 4MHZ}

//Declarations here begin //Code here while true do begin end; end.

bug in the while-construct? insert end; above the END. ---> compilation okay

t-edson commented 6 years ago

The structure WHILE in PicPas have the syntax:

  while true do
    //while body
  end;

This is different from the classic Pascal WHILE.

moonrockets commented 6 years ago

sir - may i give impression to be stolid ... i got confused about the while-construct because load your example LCD_test.pas from github-folder PicPas/samples/LCD_test/LCD_test.Pas (files uploaded may-26-2017)

okay, i got your answer, ... just close my issue ;)

t-edson commented 6 years ago

I see the error. The sample /PicPas/samples/LCD_test was written for an old version of PicPas, whe the default syntax was the classic Pascal. Now the default syntax is the Modula-2 style. Anyway, it's fixed now.