3

I'm trying to turn a string into a variable on my TI-84.

For example,

"XYZ"→Str0
fnInt(X²,sub(Str0,1,1),0,1)→A

But it's not letting me.

I know this seems like a really inefficient way of doing it (why not just do fnInt(X²,X,0,1)?), but in my program this would be very, very useful.

So is there a way to turn a string into a variable?

user3932000
  • 671
  • 8
  • 24

2 Answers2

1

If you have a string as some function and want to evaluate it for some values, you can always store it to Y1, set the variables in it to what you want, and then just use Y1 as your evaluated function.

fuzzything44
  • 701
  • 4
  • 15
  • That's not what I'm looking for, though. I need to turn a string into a variable so that I can use that variable as the variable of integration for `fnInt(`. – user3932000 Feb 20 '16 at 03:20
1

I don't think you can use a string where fnInt( expects a variable. The only thing I can recommend is to use a bunch of if statements, using I as the index of the variable you're using from your string. Basically, you'd have to write out these cases explicitly, since there's no way to make a string get interpreted as a variable for that function.

If I=1:fnInt(X²,X,0,1)→A
If I=2:fnInt(X²,Y,0,1)→A
If I=3:fnInt(X²,Z,0,1)→A
kamoroso94
  • 1,713
  • 1
  • 16
  • 19