How to resolve the algorithm Menu step by step in the HicEst programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Menu step by step in the HicEst programming language

Table of Contents

Problem Statement

Given a prompt and a list containing a number of strings of which one is to be selected, create a function that:

The function should reject input that is not an integer or is out of range by redisplaying the whole menu before asking again for a number. The function should return an empty string if called with an empty list. For test purposes use the following four phrases in a list: This task is fashioned after the action of the Bash select statement.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Menu step by step in the HicEst programming language

Source code in the hicest programming language

CHARACTER list = "fee fie,huff and puff,mirror mirror,tick tock,", answer*20

   POP(Menu=list, SelTxt=answer)

SUBROUTINE list ! callback procedure must have same name as menu argument
 ! Subroutine with no arguments: all objects are global
 ! The global variable $$ returns the selected list index
   WRITE(Messagebox, Name) answer, $$
END

  

You may also check:How to resolve the algorithm Sub-unit squares step by step in the Sidef programming language
You may also check:How to resolve the algorithm Ramanujan primes/twins step by step in the Java programming language
You may also check:How to resolve the algorithm K-d tree step by step in the Java programming language
You may also check:How to resolve the algorithm Multiple distinct objects step by step in the C++ programming language
You may also check:How to resolve the algorithm K-d tree step by step in the Phix programming language