: : what i really need to is to tell if an error message will be displayed and stop it from doing that so the program can continue or do something like
: :
: : if my menu = a string then
: : go back to my menu
: : i need some way for the menu to tell if it is a string being input
: :
: :
:
: { my menu input into a string}
: Val(MyMenuString, MyMenuInteger, ErrorCode);
: if ErrorCode <> 0 {MyMenuString is not an integer} then
: {Do something if menu is a string}
: else
: {Do something if menu is an integer}
:
:
do i have to make MyMenuString
a variable in the declaration
such as
var
MyMenuString : String;
like that
i couldn't get it to work here is the code i want it applied to
begin {Main Menu}
MMenu:= 0;
MainMenu: {Label}
ClrScr;
Game_Heading;
Writeln;
MMenu:= 0;
Main_Menu;
Readln(MMenu);
{Menu selection if a value is recieved then menu will redirect}
Case MMenu of
1 : Goto NewGame;
2 : Goto LoadingGame;
3 : Goto About;
4 : Goto Help;
5 : Goto Quit;
else
goto MainMenu;
end;
end;
thnx