Display variable and string on same line (TI-Basic)

In ti-basic for the ti-83 the plus (+) is used to concatenate strings. Like this:

Disp "foo"+" "+"bar"

Will output:

"foo bar"

You must remember to convert numbers to strings using string() though:

Disp "C=√("+string(c)+")"

Will output:

"C=√(34)"

Disp "C=√("+c+")" (no string()) will throw an error.


I know this is a little late, but it might help others as well. The Output(... command would be used in this case.

Prompt A,B
√(A^2+B^2)->C
If iPart(C)≠C
Then
Disp "C = √(",C
Output(3,7,C
Else
Disp "C = ",C
End

Just remember that the home display is 16x8 characters, which you may need as you plan out how and where to display your results.


Unfortunatelly the "string" command suggested by PGmath doesn't exist on the Ti-83/84/85/86. Actually there is no function for converting a number into a string.

But a possible solution is given here: http://tibasicdev.wikidot.com/number-to-string2

Tags:

Ti Basic