using the eval function in the TI-Nspire math librarySQLite Lua Libraryis it possible to call lua functions defined in other lua scripts in redis?Check type of variable within Ti-Nspire functionPassing equation to TI -Nspire CX as parameter?TI Nspire: Return a list in a functionLua Ti-nspire platform.window:invalidate()Constant in function of other constants - TI-Nspire CASderivate of a two variable function on one point ti-nspireHow to evaluate a function inside a written function on the TI-nspire CX cas?Ti nspire programming - definition of variables

Too early in the morning to have SODA?

Definition of 'vrit'

A word for delight at someone else's failure?

In the US, can a former president run again?

Designing a magic-compatible polearm

What is the meaning of "понаехать"?

Is there any proof that high saturation and contrast makes a picture more appealing in social media?

Did the CIA blow up a Siberian pipeline in 1982?

Covering index used despite missing column

How to work with PETG? Settings, caveats, etc

How do internally carried IR missiles acquire a lock?

Umlaut character order when sorting

How much steel armor can you wear and still be able to swim?

What triggered jesuits' ban on infinitesimals in 1632?

Why is "Congress shall have power to enforce this article by appropriate legislation" necessary?

What is "industrial ethernet"?

Print one file per line using echo

How do I see debug logs for Change Data Capture triggers in Salesforce?

How many people are necessary to maintain modern civilisation?

What was the first third-party commercial application for MS-DOS?

What constitutes a syllable?

Subtract the Folded Matrix

Second 100 amp breaker inside existing 200 amp residential panel for new detached garage

Do I have to explain the mechanical superiority of the player-character within the fiction of the game?



using the eval function in the TI-Nspire math library


SQLite Lua Libraryis it possible to call lua functions defined in other lua scripts in redis?Check type of variable within Ti-Nspire functionPassing equation to TI -Nspire CX as parameter?TI Nspire: Return a list in a functionLua Ti-nspire platform.window:invalidate()Constant in function of other constants - TI-Nspire CASderivate of a two variable function on one point ti-nspireHow to evaluate a function inside a written function on the TI-nspire CX cas?Ti nspire programming - definition of variables






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








3















I am trying to understand how to use the TI-Nspire CAS system through Lua. I am trying to emulate the
solve(x+5/3,x)
functionality found in the TI-Nspire CX CAS gui.



I looked through the API Docs found here : https://education.ti.com/download/en/ed-tech/59108CCE54484B76AF68879C217D47B2/7EFB09CED41C4190AFF8F60283B6727A/TI-NspireLuaScriptingAPIReferenceGuide.pdf



I believe what I am looking for is the eval function on page 51 although I can't find much online to sample from. The examples provided are not concrete ones.



math.eval(math_expression) --apilevel = 2.0
math.eval(math_expression, [exact]) --apilevel = 1.0


local expr = "f1("..mx")"
return math.eval(expr)


Iv'e tried



require "math"
local answer
answer = math.eval("f1(x+3/4,x)")
answer = math.eval(x+3/4,x)
answer = math.eval("5+9")


I keep getting the error "cannot execute during initialization."



1) How do you fix the error



2) May I have some concrete examples of using the function










share|improve this question
























  • I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

    – soegaard
    Mar 25 at 13:15

















3















I am trying to understand how to use the TI-Nspire CAS system through Lua. I am trying to emulate the
solve(x+5/3,x)
functionality found in the TI-Nspire CX CAS gui.



I looked through the API Docs found here : https://education.ti.com/download/en/ed-tech/59108CCE54484B76AF68879C217D47B2/7EFB09CED41C4190AFF8F60283B6727A/TI-NspireLuaScriptingAPIReferenceGuide.pdf



I believe what I am looking for is the eval function on page 51 although I can't find much online to sample from. The examples provided are not concrete ones.



math.eval(math_expression) --apilevel = 2.0
math.eval(math_expression, [exact]) --apilevel = 1.0


local expr = "f1("..mx")"
return math.eval(expr)


Iv'e tried



require "math"
local answer
answer = math.eval("f1(x+3/4,x)")
answer = math.eval(x+3/4,x)
answer = math.eval("5+9")


I keep getting the error "cannot execute during initialization."



1) How do you fix the error



2) May I have some concrete examples of using the function










share|improve this question
























  • I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

    – soegaard
    Mar 25 at 13:15













3












3








3








I am trying to understand how to use the TI-Nspire CAS system through Lua. I am trying to emulate the
solve(x+5/3,x)
functionality found in the TI-Nspire CX CAS gui.



I looked through the API Docs found here : https://education.ti.com/download/en/ed-tech/59108CCE54484B76AF68879C217D47B2/7EFB09CED41C4190AFF8F60283B6727A/TI-NspireLuaScriptingAPIReferenceGuide.pdf



I believe what I am looking for is the eval function on page 51 although I can't find much online to sample from. The examples provided are not concrete ones.



math.eval(math_expression) --apilevel = 2.0
math.eval(math_expression, [exact]) --apilevel = 1.0


local expr = "f1("..mx")"
return math.eval(expr)


Iv'e tried



require "math"
local answer
answer = math.eval("f1(x+3/4,x)")
answer = math.eval(x+3/4,x)
answer = math.eval("5+9")


I keep getting the error "cannot execute during initialization."



1) How do you fix the error



2) May I have some concrete examples of using the function










share|improve this question
















I am trying to understand how to use the TI-Nspire CAS system through Lua. I am trying to emulate the
solve(x+5/3,x)
functionality found in the TI-Nspire CX CAS gui.



I looked through the API Docs found here : https://education.ti.com/download/en/ed-tech/59108CCE54484B76AF68879C217D47B2/7EFB09CED41C4190AFF8F60283B6727A/TI-NspireLuaScriptingAPIReferenceGuide.pdf



I believe what I am looking for is the eval function on page 51 although I can't find much online to sample from. The examples provided are not concrete ones.



math.eval(math_expression) --apilevel = 2.0
math.eval(math_expression, [exact]) --apilevel = 1.0


local expr = "f1("..mx")"
return math.eval(expr)


Iv'e tried



require "math"
local answer
answer = math.eval("f1(x+3/4,x)")
answer = math.eval(x+3/4,x)
answer = math.eval("5+9")


I keep getting the error "cannot execute during initialization."



1) How do you fix the error



2) May I have some concrete examples of using the function







lua ti-nspire






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 22:24









Piglet

8,94621123




8,94621123










asked Mar 25 at 6:48









Max NovaMax Nova

165




165












  • I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

    – soegaard
    Mar 25 at 13:15

















  • I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

    – soegaard
    Mar 25 at 13:15
















I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

– soegaard
Mar 25 at 13:15





I think @Piglet has the answer - but when testing - use the simplest example possible. That is use answer = math.eval("5+9"). Also don't expect too much. The Lua API is ... well ... not exactly rich in the "working with expressions" department.

– soegaard
Mar 25 at 13:15












2 Answers
2






active

oldest

votes


















1














From the TI-Nspire Lua Scripting API Reference Manual 12.1 math.eval:




Warning



math.eval is not available during script initialization




To avoid this error do not call the function befor script is initialized.






share|improve this answer























  • What does it mean to initialize the script and how do you do that?

    – Max Nova
    Mar 26 at 9:14











  • @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

    – Piglet
    Mar 26 at 9:33


















0














This works!



function on.paint(gc)
local var1
var1 = math.eval("nsolve(x+4=8,x)")
gc:drawString(var1, 2, 20)
end





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332497%2fusing-the-eval-function-in-the-ti-nspire-math-library%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    From the TI-Nspire Lua Scripting API Reference Manual 12.1 math.eval:




    Warning



    math.eval is not available during script initialization




    To avoid this error do not call the function befor script is initialized.






    share|improve this answer























    • What does it mean to initialize the script and how do you do that?

      – Max Nova
      Mar 26 at 9:14











    • @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

      – Piglet
      Mar 26 at 9:33















    1














    From the TI-Nspire Lua Scripting API Reference Manual 12.1 math.eval:




    Warning



    math.eval is not available during script initialization




    To avoid this error do not call the function befor script is initialized.






    share|improve this answer























    • What does it mean to initialize the script and how do you do that?

      – Max Nova
      Mar 26 at 9:14











    • @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

      – Piglet
      Mar 26 at 9:33













    1












    1








    1







    From the TI-Nspire Lua Scripting API Reference Manual 12.1 math.eval:




    Warning



    math.eval is not available during script initialization




    To avoid this error do not call the function befor script is initialized.






    share|improve this answer













    From the TI-Nspire Lua Scripting API Reference Manual 12.1 math.eval:




    Warning



    math.eval is not available during script initialization




    To avoid this error do not call the function befor script is initialized.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 25 at 8:24









    PigletPiglet

    8,94621123




    8,94621123












    • What does it mean to initialize the script and how do you do that?

      – Max Nova
      Mar 26 at 9:14











    • @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

      – Piglet
      Mar 26 at 9:33

















    • What does it mean to initialize the script and how do you do that?

      – Max Nova
      Mar 26 at 9:14











    • @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

      – Piglet
      Mar 26 at 9:33
















    What does it mean to initialize the script and how do you do that?

    – Max Nova
    Mar 26 at 9:14





    What does it mean to initialize the script and how do you do that?

    – Max Nova
    Mar 26 at 9:14













    @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

    – Piglet
    Mar 26 at 9:33





    @MaxNova I don't know. I could not find anything in the manual. I guess you have to run some other function first. As TI-Nspire is a commercial product I suggest you ask their support for help. TI's support is usually very good.

    – Piglet
    Mar 26 at 9:33













    0














    This works!



    function on.paint(gc)
    local var1
    var1 = math.eval("nsolve(x+4=8,x)")
    gc:drawString(var1, 2, 20)
    end





    share|improve this answer



























      0














      This works!



      function on.paint(gc)
      local var1
      var1 = math.eval("nsolve(x+4=8,x)")
      gc:drawString(var1, 2, 20)
      end





      share|improve this answer

























        0












        0








        0







        This works!



        function on.paint(gc)
        local var1
        var1 = math.eval("nsolve(x+4=8,x)")
        gc:drawString(var1, 2, 20)
        end





        share|improve this answer













        This works!



        function on.paint(gc)
        local var1
        var1 = math.eval("nsolve(x+4=8,x)")
        gc:drawString(var1, 2, 20)
        end






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 3 at 3:07









        Max NovaMax Nova

        165




        165



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332497%2fusing-the-eval-function-in-the-ti-nspire-math-library%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript