Recent

Author Topic: giving error  (Read 1167 times)

fabio_faria

  • Newbie
  • Posts: 3
giving error
« on: October 18, 2018, 10:17:23 pm »
project1.lpr(5,3) Fatal: Syntax error, "BEGIN" expected but "USES" found
Code: Pascal  [Select][+][-]
  1. program eu;
  2. label sim;
  3. label nao;
  4.  
  5.   uses crt,math;
  6.    var s_n:char;
  7.         score:integer;
  8.  
  9. procedure drawbox(x,y,width,height:integer;title:string);
  10. var i1,i2:integer;
  11. begin
  12.         for i2:=1 to height do
  13.         begin
  14.                 gotoxy(x,y+i2-1);
  15.                 for i1:=1 to width do
  16.                 begin
  17.                         if (i1 > 1) and (i1 < width) and (i2 > 1) and (i2 < height) then
  18.                                 write(' ')
  19.                         else
  20.                                 write('=');
  21.                 end;
  22.         end;
  23.         if (title <> '') then
  24.         begin
  25.                 i1 := y+floor((height-1)/2);
  26.                 i2 := x+floor(width/2-length(title)/2);
  27.                 gotoxy(i2,i1);
  28.                 write(title);
  29.         end;
  30. end;
  31. procedure sa;
  32. begin
  33.         delay(100);
  34.  
  35. end;
  36. procedure g(a:string);
  37. begin;
  38.   write(a);
  39.  end;
  40. procedure spa(spa:integer);
  41. begin
  42.   score:=0;
  43.   repeat
  44.    write (' ');
  45.    score:=score+1;
  46.   until score=spa ;
  47. end;
  48. procedure  clrln;
  49. begin
  50.   gotoxy(23,4);
  51.    clreol;
  52.    gotoxy(80,4);
  53.    textcolor(white);
  54.    write('=');
  55.    gotoxy(21,4);
  56.    textcolor(red);
  57.    score:=0;
  58.   repeat
  59.    write (' ');
  60.    score:=score+1
  61.   until score=1 ;
  62.    write ('| ');
  63.    sa;
  64.   end;
  65. procedure s0;
  66.  begin
  67.    score:=0;
  68.  end;
  69.  
  70.  
  71. begin
  72.   score:=0;
  73.   drawbox(1,1,80,11,'');
  74.   gotoxy(2,2);
  75.   spa(10);
  76.   textcolor(white);
  77.   write('________');
  78.   score:=0;
  79.   gotoxy(2,3);
  80.   spa(9);
  81.   write ('/ 0    0 \');
  82.   score:=0;
  83.    gotoxy(2,4);
  84.   spa(8);
  85.   write ('|   /\    |');
  86.   score:=0;
  87.      gotoxy(2,5);
  88.   spa(8);
  89.   write ('|   ==    |');
  90.   score:=0;
  91.        gotoxy(2,6);
  92.   spa(8);
  93.   write ('| \____/  |');
  94.   score:=0;
  95.         gotoxy(2,7);
  96.   spa(9);
  97.   write ('\________/');
  98.   score:=0;
  99.          gotoxy(2,8);
  100.   spa(10);
  101.   textcolor(green);
  102.   write ('___||___');
  103.   score:=0;
  104.            gotoxy(2,9);
  105.   spa(8);
  106.   write ('_/   \/   \_');
  107.   score:=0;
  108.   gotoxy(2,10);
  109.   spa(7);
  110.   write ('/ /    |    \ \');
  111.   score:=0;
  112.          gotoxy(21,6);
  113.   textcolor(red);
  114.   spa(1);
  115.   write ('/_/');
  116.   score:=0;
  117.            gotoxy(21,5);
  118.   repeat
  119.    write (' ');
  120.    score:=score+1
  121.   until score=1 ;
  122.   write ('|  ___________________/');
  123.   score:=0;
  124.   gotoxy(22,3);
  125.   repeat
  126.    write (' ');
  127.    score:=score+1
  128.   until score=1 ;
  129.   write('/                    \');
  130.   score:=0;
  131.    gotoxy(23,2);
  132.   repeat
  133.    write (' ');
  134.    score:=score+1
  135.   until score=1 ;
  136.   write('____________________');
  137.   score:=0;
  138.   gotoxy(21,4);
  139.   repeat
  140.    write (' ');
  141.    score:=score+1
  142.   until score=1 ;
  143.    write ('| ');
  144.    sa;
  145.    g('O');
  146.    sa;
  147.    g('l');
  148.    sa;
  149.    g('a');
  150.    sa;
  151.    g(' e');
  152.    sa;
  153.    g('u');
  154.    sa;
  155.    g(' s');
  156.    sa;
  157.    g('o');
  158.    sa;
  159.    g('u');
  160.    sa;
  161.    g(' o');
  162.    sa;
  163.    g(' F');
  164.    sa;
  165.    g('a');
  166.    sa;
  167.    g('b');
  168.    sa;
  169.    g('i');
  170.    sa;
  171.    g('o');
  172.    sa;
  173.    g('! |');
  174.    delay(1000);
  175.    gotoxy(40,2);
  176.    write('__________');
  177.    gotoxy(40,3);
  178.    write ('          \');
  179.    gotoxy(40,5);
  180.    write('__________/');
  181.    clrln;
  182.    g('G');
  183.    sa;
  184.    g('o');
  185.    sa;
  186.    g('s');
  187.    sa;
  188.    g('t');
  189.    sa;
  190.    g('a');
  191.    sa;
  192.    g('r');
  193.    sa;
  194.    g('i');
  195.    sa;
  196.    g('a');
  197.    sa;
  198.    g('s');
  199.    sa;
  200.    g(' d');
  201.    sa;
  202.    g('e');
  203.    sa;
  204.    g(' m');
  205.    sa;
  206.    g('e');
  207.    sa;
  208.    g(' c');
  209.    sa;
  210.    g('o');
  211.    sa;
  212.    g('n');
  213.    sa;
  214.    g('h');
  215.    sa;
  216.    g('e');
  217.    sa;
  218.    g('c');
  219.    sa;
  220.    g('e');
  221.    sa;
  222.    g('r? |');
  223.    sa;
  224.    s_n:=0;
  225.    gotoxy(25,1);
  226.    readln(s_n);
  227.    case s_n of
  228.     'sim':goto sim;
  229.     'nao':begin
  230.      clrln;
  231.      g('Q');
  232.      sa;
  233.      g('u');
  234.      sa;
  235.      g('e');
  236.      sa;
  237.      g(' p');
  238.      sa;
  239.      g('e');
  240.      sa;
  241.      g('n');
  242.      sa;
  243.      g('a');
  244.      sa;
  245.     end;
  246.    end;
  247.   readln;
  248.  end.
  249.  


------------------------------------------------------------------------------------------------------------------------first: the program is in portuguese;
second:the error must be at the beggining


« Last Edit: October 18, 2018, 10:24:47 pm by fabio_faria »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: giving error
« Reply #1 on: October 18, 2018, 10:18:28 pm »
label after the uses.

fabio_faria

  • Newbie
  • Posts: 3
Re: giving error
« Reply #2 on: October 18, 2018, 10:27:02 pm »
thanks marcov  ;)

fabio_faria

  • Newbie
  • Posts: 3
Re: giving error
« Reply #3 on: October 18, 2018, 10:30:59 pm »
PS: ik that the program haves othe errors but this was the only one i couldnt fix

 

TinyPortal © 2005-2018