Omnimaga
Calculator Community => TI Calculators => Lua => Topic started by: kyllopardiun on August 21, 2011, 11:03:28 am
-
Well, I am trying to do a small program [sorry guys, but isn't a game] it is for testing the convergence of series..
And I was wondering if I could do this in a colorful, and beautiful way with lua, but, is possible to call a TI-Basic program within lua code:
I mean like:
function convergence.power()
callmyBasicPrgm()
end
or if possible:
function convergence.power()
Local rterm,aterm,sumv
:clrio
:Try
:lim((equ(x))^(((1)/(x))),x,∞,1)→rterm
:Else
:If errornum=800 Then:
:(...)
:Return 0
end
-
I believe that you can run single lines of TI-BASIC code, but not full programs (for example, loops and jumps are not supported).
-
There's a math.eval() function for interacting with TI-Basic, so you might be able to call a pre-existing function from that.
/speculations.
-
For now you can't launch a TI-Basic program, but a TI-Basic function, yes (with math.eval that works exactly as expr() in TI-Basic).
The return value of math.eval() is the return value of the expression.
For example : a = math.eval("remain(100,6)")
a will be 4
-
Ok. Thank you, all, for the replies ..
[=
-
I believe that you can run single lines of TI-BASIC code, but not full programs (for example, loops and jumps are not supported).
Yes Loops, and Goto-Label are supported ! Even Try:Else:EndTry function for example. :)
-
I believe that you can run single lines of TI-BASIC code, but not full programs (for example, loops and jumps are not supported).
Yes Loops, and Goto-Label are supported ! Even Try:Else:EndTry function for example. :)
But I have to do they in math.eval() or how can I access these functions?
-
You just have to paste your basic code into "" :
(Use ":" for a new line of code, as you can do in the calculus line)
For example :
math.eval("0=:c:While c<10:c+1=:c:EndWhile")
And you can put all other structures like Lbl, For, Loop, Try, ... :)