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

Gaining Proficiency in Vehicles (water)

What kind of Chinook helicopter/airplane hybrid is this?

Who goes first? Person disembarking bus or the bicycle?

Other Space Shuttle O-ring failures

Tesco's Burger Relish Best Before End date number

Wires do not connect in Circuitikz

Appropriate conduit for several data cables underground over 300' run

Need a non-volatile memory IC with near unlimited read/write operations capability

Draw a diagram with rectangles

When do flights get cancelled due to fog?

What is the meaning of "prairie-dog" in this sentence?

Intern not wearing safety equipment; how could I have handled this differently?

How should I ask for a "pint" in countries that use metric?

What was the profession 芸者 (female entertainer) called in Russia?

Can Jimmy hang on his rope?

What was the significance of Spider-Man: Far From Home being an MCU Phase 3 film instead of a Phase 4 film?

Deck of Cards with Shuffle and Sort functionality

Computer name naming convention for security

Gory anime with pink haired girl escaping an asylum

How do I talk to my wife about unrealistic expectations?

Can a landlord force all residents to use the landlord's in-house debit card accounts?

Why do airports remove/realign runways?

What does "spinning upon the shoals" mean?

QR codes, do people use them?



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 margin-bottom:0;








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,9732 gold badges11 silver badges23 bronze badges




8,9732 gold badges11 silver badges23 bronze badges










asked Mar 25 at 6:48









Max NovaMax Nova

166 bronze badges




166 bronze badges












  • 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,9732 gold badges11 silver badges23 bronze badges




    8,9732 gold badges11 silver badges23 bronze badges












    • 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

        166 bronze badges




        166 bronze badges



























            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