Hello,
I'm trying to create a menu with choices.
When the user will press 1 will call the option1.
When the user will press 2 will call the option2.
.
.
.
else will system halt.
When the user will press 1 will call the option1.
my code works for only 2 choices:
when I try to add more I still get the option2
I need to add at least 5 choices.
menou:-
write('Menou:\n'),
write('Press [1] to ....\n'),
write('Press [2] to ....\n'),
write('Enter choise:'),
read(Key),
Key=1->write('\n1.'),option1;
Key=2->write('\n2.'),option2;
write('\nWrong option.').
option1:-write('option1 selected').
option2:-write('option2 selected').
Thanks in advance.
I'm trying to create a menu with choices.
When the user will press 1 will call the option1.
When the user will press 2 will call the option2.
.
.
.
else will system halt.
When the user will press 1 will call the option1.
my code works for only 2 choices:
when I try to add more I still get the option2
I need to add at least 5 choices.
menou:-
write('Menou:\n'),
write('Press [1] to ....\n'),
write('Press [2] to ....\n'),
write('Enter choise:'),
read(Key),
Key=1->write('\n1.'),option1;
Key=2->write('\n2.'),option2;
write('\nWrong option.').
option1:-write('option1 selected').
option2:-write('option2 selected').
Thanks in advance.