Mi dice che c'è un errore ma dov'è??

codice:
Program potenze;
uses crt;
var base:integer;
    espo:byte;
    r:real;

Function Potenza(base:integer;esponente:byte):real;
var i:byte;
    x:real;
begin
	if esponente=0 then
		Potenza:=1
	else
	begin
	x:=1;
		for i:=1 to esponente
			x:=x*base;
		Potenza:=x;
	end;
end;

begin
	clrscr;
	TextBackground(4);
	TextColor(2);
	writeln('Benvenuto in allrisolveer (modalità potenze)');
	write('Inserisci la base e premi invio:');
	readln(base);
	write('Inserisci l''esponente e premi invio (da 0 a 255):');
	readln(espo);
	r:=Potenza(base,espo);
	writeln(base,' alla ',espo,'° è ',r);
	writeln('Per risolvere un'altra potenza devi premere invio');
	readln
end.