Request returns error w/ radicals

14 views
Skip to first unread message

MWarnerCA

unread,
May 20, 2012, 12:13:49 PM5/20/12
to tinspire
Hoping for some help on this one...

In writing math programs, when I use the Request command, if integers
are entered in the dialog box, all's good. However, if a radical (ex:
root 2) is used, I get "Error: Missing (". It makes no matter if I
enter the root in the dialog box in parentheses, use the absolute
value sign in the a+b equation or use parentheses in the program
("Check Syntax" deletes them).

Anyone have any thoughts?

Here's a simple example:

Define sample()=
Prgm
:Request "What is the first number?",a
:Request "What is the second number?",b
:Disp a+b
:EndPrgm

What is the first number? √2
"Error: Missing ("

Andy Kemp

unread,
May 20, 2012, 12:38:44 PM5/20/12
to tins...@googlegroups.com
This is because of the way the request function takes its input.  You need to type √(2) or sqrt(2)


--
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
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

Eric Findlay

unread,
May 20, 2012, 1:22:02 PM5/20/12
to tins...@googlegroups.com
If you change the program to a function instead, and pass the values as parameters, you should not get this error.

Define Sample(a, b)=
Func
Return a+b
Endfunc

This is one of the reasons I did not want TI to do requests and input - it introduces so many more complications and problems.

A note to everyone out there, remember to always check you data types when getting input from the users because you might expect a number and they enter a string.  Or you're asking for a denominator and they enter 0.  A good program should never end with a system error.

  --Eric

Jim Fullerenex

unread,
May 20, 2012, 7:57:45 PM5/20/12
to tins...@googlegroups.com
Well, if OS 2.0 hadn't introduced the "request" box, the already weak Nspire Basic would've been even weaker.

Best,

Jim
Reply all
Reply to author
Forward
0 new messages