Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: kyllopardiun on August 21, 2011, 11:03:28 am

Title: TI basicsh-luna
Post 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:
Code: [Select]
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
Title: Re: TI basicsh-luna
Post by: JosJuice on August 21, 2011, 11:06:10 am
I believe that you can run single lines of TI-BASIC code, but not full programs (for example, loops and jumps are not supported).
Title: Re: TI basicsh-luna
Post by: NecroBumpist on August 21, 2011, 11:06:59 am
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.
Title: Re: TI basicsh-luna
Post by: Levak on August 21, 2011, 11:39:19 am
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
Title: Re: TI basicsh-luna
Post by: kyllopardiun on August 21, 2011, 11:58:00 am
Ok. Thank you, all, for the replies ..

[=
Title: Re: TI basicsh-luna
Post by: Loulou 54 on August 21, 2011, 04:49:00 pm
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. :)
Title: Re: TI basicsh-luna
Post by: kyllopardiun on August 21, 2011, 05:07:40 pm
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?
Title: Re: TI basicsh-luna
Post by: Loulou 54 on August 22, 2011, 03:35:09 pm
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, ... :)