I want to make a menu, it's for a game, to try the case
and procedure
, but it does not work. This is the code:
Program Juego;
uses crt;
Procedure Menu;
var op:integer;
begin
Writeln ('Seleccione una opcion') ;
Writeln ('1-Informacion');
Writeln ('2-Salir');
Read(op);
Case op of
1:Procedure Informacion ;
2:Procedure Salir ;
else Writeln('Seleccione una opcion del 1 al 2');
end;
end;
Procedure Informacion;
begin
Writeln('Desarrollado por:');
Readln();
end;
Procedure Salir;
var s:integer;
begin
Writeln('¿Esta seguro que desea salir?');
Writeln('1-SI');
Writeln('2-NO');
Read(s);
If s=1 then
Halt(0);
If s=0 then
Procedure Menu;
end;
begin
Procedure Menu;
end.
This is the error you give me:
Juego.pas(11,13) Error: Illegal expression Juego.pas(12,2) Error: Constant Expression expected Juego.pas(12,2) Fatal: Syntax error, ":" expected but "ordinal const" found Fatal: Compilation aborted