I really like Nelson's solution, but here's another anyway. If it's a
program, then you can use the following code snippet:
Local done, var
done:=false
...
While not done
Try
RequestText "Arm or Hyp?",var,0
If not getType(var)="NONE" and (var="Arm" or var="Hyp")
done:=true
Else
ClrErr
EndTry
EndWhile
Now, you can decide if you want to support upper and/or lower case
responses. In fact, you can just convert it to upper or lower case via
my String library. I'm pretty sure it's up on Lafacroft. If not, I can
post it here.
--
For I am convinced that neither death nor life, neither angels nor
demons, neither the present nor the future, nor any powers, neither
height nor depth, nor anything else in all creation, will be able to
separate us from the love of God that is in Christ Jesus our Lord.
- Romans 8:38-39 (NIV)
--
Eric Findlay
AKA Eagle-Man
On 22/04/2010 4:09 AM, Matt Rhodes wrote:
> As practice in programming, I'm interested in creating a program that
> will solve for missing sides of a right triangle by using the
> pythagorean theorem. Of course, there are two options, solve for a
> leg or the hypotenuse. So, within the program, I want to offer the
> user the ability to choose which path they want to take.
> Consequently, I need a menu of choices to be displayed and I need a
> request at the same time. As far as I can see, the request option
> will not diplay on two lines and I can't find a way to first display
> the menu and then do a "pause" as we could on the TI-84 before the
> request is diplayed.
>
> So, I have a two-part question. Is there a way to pause the program
> before requesting the variable or is there a way to do a two line
> request from the user.
>
> For that matter, is there a better way for the user to make a choice
> from a displayed list of options?
>
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG -
www.avg.com
> Version: 9.0.801 / Virus Database: 271.1.1/2829 - Release Date: 04/22/10 11:31:00
>