[tinspire] Programming Menus

639 views
Skip to first unread message

Matt Rhodes

unread,
Apr 22, 2010, 7:09:59 AM4/22/10
to tinspire
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?

--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
http://lafacroft.com/archive/nspire.php

Steve Arnold

unread,
Apr 22, 2010, 7:17:22 AM4/22/10
to tins...@googlegroups.com
You could use the "Text" command first to explain the choices (and it is no tlimited in length like the Request commands) - and give a pause until the user is ready to go on. Then your request can be quite brief.

For example,

Text "To choose the hypotenuse, press 1. For a side, press 2."

Request "Hypotenuse (1) or Side (2)?", input

Steve
With best wishes,
Steve
_________________
Dr Stephen Arnold
Educational Technology Consultant
Compass Learning Technologies

T3 Fellow, Teachers Teaching with Technology Australia

Office: +61-2-4232-2080
Mobile: +61-4-0175-3834
Web: http://compasstech.com.au
_________________

Nelson Sousa

unread,
Apr 22, 2010, 7:36:31 AM4/22/10
to tins...@googlegroups.com

unfortunately the answer to both questions is no.
the program only "pauses" while waiting for user input on a request box or until the user clicks OK on a text box and request boxes can only ask for 1 value/string. Even dialog boxes that display text can't be mixed with variable requests.

You need to have a request where the user must enter one of two values and then two other requests for both sides.

But there's a better way:
- 1st request: enter hypotenuse;
- 2nd requests: enter leg 1;
- 3rd request: enter leg2;

And your code can parse the input: if it's a number is one of the givens, if it's '?' it's the unknown.

In the end you display all the info you want and ask the user if he wants to solve for a new triangle or leave the program.

Cheers,
Nelson

elkar

unread,
Apr 22, 2010, 12:32:51 PM4/22/10
to tinspire
Please developers of TI-NSPIRE CAS incorporating the remaining ti-89
commands, dialog boxes, pause, clearHome -> ClearHistory each time you
start a program you want to clean history

We also want a command to pause a program

Thank you very much

Matt Rhodes

unread,
Apr 23, 2010, 3:31:45 PM4/23/10
to tinspire
I would like to second that notion. These commands seem like trivial
programming compared to what's already been done.

Holly - take note!

On Apr 22, 12:32 pm, elkar <elkinarbel...@gmail.com> wrote:
> Please developers of TI-NSPIRE CAS incorporating the remaining ti-89
> commands, dialog boxes, pause, clearHome -> ClearHistory each time you
> start a program you want to clean history
>
> We also want a command to pause a program
>
> Thank you very much
>
> --
> To post to this group, send email to tins...@googlegroups.com
> To unsubscribe send email to tinspire+u...@googlegroups.com
> For more options, visit this group athttp://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB

Eric Findlay

unread,
Apr 23, 2010, 9:01:18 PM4/23/10
to tins...@googlegroups.com
I'm not sure you'll get this for the following reasons:

1) Pause - when do you need to pause without displaying some sort of
output? You can just use the Text command.

2) ClearHome - what if this program is invoked on a non-calculator app?
What does in mean then? What if you want it to act one way for one
type of app and not for another? It's too complicated.

Although, I agree about dialog boxes, especially if it means things like
radio buttons and combo boxes.

--
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 9:32 AM, elkar wrote:
> Please developers of TI-NSPIRE CAS incorporating the remaining ti-89
> commands, dialog boxes, pause, clearHome -> ClearHistory each time you
> start a program you want to clean history
>
> We also want a command to pause a program
>
> Thank you very much
>
>
>
>
>
> 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

Eric Findlay

unread,
Apr 23, 2010, 9:05:58 PM4/23/10
to tins...@googlegroups.com
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
>

elkar

unread,
Apr 26, 2010, 9:32:51 AM4/26/10
to tinspire
For there is no conflict with other applications, ClearHistory, Pause,
and dialogue boxes then that only work in the calculator application

I have several programs written with dialog boxes, and I want to port
to the TI-Nspire CAS
similar to those that are in www.ti89.com

The following survey shows that the TI-Nspire lacks the power of TI-89/
Voyage200

http://www.calculadoras.cl/foro/showthread.php?t=11955

Nelson Sousa

unread,
Apr 26, 2010, 10:17:33 AM4/26/10
to tins...@googlegroups.com

not meaning to question the merits of the request for more programming power, a survey such as this doesn't have any valitity whatsoever: it has a total of 14 votes and, as with any web based survey, doesn't have any sort of sampling validation.

Regarding porting of programs from 89 to Nspire: a lot can be done using new techniques developed on the Nspire, most of them available on the archives of this group. Both input and output can be achieved using geometric constructions and suitable spreadsheets. Plus now we can call programs (not just functions) from interactive notes pages. I'm not implying that this is enough, I too would like to have simpler programming on the Nspire to achieve the same results we had before, but I wouldn't go as far as saying that pause or richer dialog boxes are on top of my priority list. I would rather have the ability to have a program navigate between pages of a document to create interactive content for the classroom. Much more than the ability to recreate what has already been done and using the same old programming paradigms.


Cheers,
Nelson
Reply all
Reply to author
Forward
0 new messages