Ouput multiple variables, or mix them with text
#1
Posted 01 November 2017 - 05:13 PM
"RESULT - "+x
On Fx-9750G Plus. How can I do that? I've tried to fins Str on this device, but didn't find it.
#2
Posted 01 November 2017 - 11:10 PM
What is +x? Is that supposed to be a number? If so, use NumToStr to convert the number to a string.
Then use StrJoin to join those 2 strings together. Then print the string. Suppose X = 5.
Let use say that X is the number:
NumToStr X,"fix2",x
What I have done is I have taken the number that is in variable X (upper case) and told it to output the number with 2 decimal places to the variable x (lower case) as a string. I like to use upper/lower case so I do not overwrite the original. Using the same letter lets me remember where the original came from.
As for "fix2". Yes, the quotes are needed. Unfortunately, you are limited to using fix or scientific for output. You cannot use "normal" for outputting. Yeah, it becomes a headache if you do not want decimals because you must then trim your strings using TrimLen, TrimLeft, etc and perhaps create some more math routines to get it to do what you want.
Next:
StrJoin "Result - ", x, x
This joins the string "Result - " and the string in variable x (lower case) and then shoves it back into the variable x and over writes the previous string. You can also send it to a different variable if you like wasting variables.
Finally:
Print x
Your result should be what I think you desire.
Result - 5.00
#3
Posted 28 November 2017 - 07:00 AM
You may output more than one variable as List:
{x,y,r}$
$ is the stop triangle. I cannot use text in this environement with my fx-9860.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users