Post Reply 
Now don't run ?
05-06-2016, 06:43 AM
Post: #1
Now don't run ?
Hi,
An old program from Mic Nick now don't run. I don't know why, may be help ?

Thanks.

Gérard.
Find all posts by this user
Quote this message in a reply
05-06-2016, 02:01 PM (This post was last modified: 05-06-2016 02:02 PM by Tim Wessman.)
Post: #2
RE: Now don't run ?
Hello,

The reason is because when INPUT(f,"...") is run, the expression you type is EVALUATED. If X=2, and you type X^2-1, on exit the INPUT form evaluates and you get 2^2-1, or 3 as your value for f.

You can either put your expression inside ' ' using the two keys [SHIFT][ ( ) ], or put in " " around your expression.

'X^2-1' or "X^2-1" will both work.

You can modify the program to be like this to avoid needing to do ' ' or " ".

INPUT({{f,[2]}}, ....);

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-07-2016, 06:44 AM
Post: #3
RE: Now don't run ?
Hi Tim,
Very many thank you. It run now.

Good day.

Gérard.
Find all posts by this user
Quote this message in a reply
05-07-2016, 07:30 AM (This post was last modified: 05-07-2016 07:40 AM by leprechaun.)
Post: #4
RE: Now don't run ?
Cool.
Could someone elaborate a bit on the reason that the proposed sollution works? Would be really helpful. I am confused because of the double list and the vector [2] which I cannot explain.

edit: well some thinking and a fresh cup of coffee made me realize that [2] is the allowed type String. Is it right that in this case the entry is converted to an unevaluated string because you specified that the allowed type is string?
Find all posts by this user
Quote this message in a reply
05-07-2016, 07:58 PM
Post: #5
RE: Now don't run ?
Exactly, specifiying string means it will not evaluate anything. Storing into F1:="<string>" is a special case and will convert to an expression.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)