05-06-2016, 06:43 AM
05-06-2016, 02:01 PM
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]}}, ....);
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]}}, ....);
05-07-2016, 06:44 AM
Hi Tim,
Very many thank you. It run now.
Good day.
Very many thank you. It run now.
Good day.
05-07-2016, 07:30 AM
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?
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?
05-07-2016, 07:58 PM
Exactly, specifiying string means it will not evaluate anything. Storing into F1:="<string>" is a special case and will convert to an expression.