fraday15
fraday15

Reputation: 53

toString() alternative for a ti-84+ for number values assigned to a variable

I am trying to make a program that takes 2 given points and calculates the straight line in between them using either point-slope or slope-intercept based on the users choice. I have a few variables (C, A, E) that are the final variables in my math. I have put these variables into 2 Disp lines:

Disp "Y-"+C+"="+E+"(X-"+A+")"

and

Disp "Y="+E+"X+"+(C-EA)

But it returns me with the error Error: Data Type because they are in math value form when they need to be converted to a string. Unfortunately, I do not have the Color Edition version of the TI-84+ so I do not have the toString() command. Is there an alternative for converting a math value in a variable to a string?

Upvotes: 1

Views: 1823

Answers (2)

fraday15
fraday15

Reputation: 53

I found a method at http://tibasicdev.wikidot.com/number-to-string that works perfectly and then an even better for a list (http://tibasicdev.wikidot.com/list-to-string) which is exactly what i needed.

Upvotes: 1

hobbs
hobbs

Reputation: 239712

You can use a comma (,) instead of + between the elements of the Disp. The output will span multiple lines, with strings justified left and numbers justified right, which isn't very beautiful, but it's pretty much the best that you can do in 83/84 BASIC.

In some other situations you could use Output instead of Disp to place the output on the screen, but the problem is that with numbers, you generally don't know how many columns the number will take to display, which makes it difficult to avoid overlaps when using Output.

Upvotes: 2

Related Questions