0

Console to test sql/nx statements

Is there a console or someway to run arbitray nx/sql statements? I'm finding the nx script a bit confusing and there's not any way I can see to preview statements to see their result outside of alert() boxes which is clunky. 

8 replies

null
    • Mconneen
    • 4 yrs ago
    • Reported - view

    Yes.. there is... 

    Go into admin mode by clicking on the wrench in the upper right.. 

    Then select console.. 

    Then have fun!

    console

    • Rob.1
    • 4 yrs ago
    • Reported - view

    Perfect :) thanks very much. Had a feeling it was there somewhere 😀

    • JGM
    • Jose_Monteiro
    • 4 yrs ago
    • Reported - view

    Hello,

    This question is about output using the console.

    As I understand we write commands in the Input Panel and get results in the Output Panel.

    But we get only the result of the last executed command.
    For instance if I have the following code:

    let A := [10, 20, 30];
    for j in A do
        "square= " + j * j;
        "cube= " + j * j * j;
    end

    I get only the output of the last command in the for loop:
    cube= 1000
    cube= 8000
    cube= 27000

    I would like to get the output of both lines, something like:
    square= 100
    cube= 1000
    square= 400
    cube= 8000
    square= 900
    cube= 27000

    Is there any way of creating output from other commands besides the last one, like a print statment?

     

    Jose

    • Sean
    • 4 yrs ago
    • Reported - view

    Instead of using two separate lines make it one with a line feed between them.

     

    let A := [10, 20, 30];
    for j in A do
    "square= " + j * j + "
    " + "cube= " + j * j * j;
    end

    • JGM
    • Jose_Monteiro
    • 4 yrs ago
    • Reported - view

    Thanks for your reply.

    This was just a simple example.

    In more complex cases with larger blocks of code I would like to get the result of calculations in several points of the code block (not only from two adjacent lines) and see the result in the Output Panel.

    After being sure it is working as expected then I would insert the code in the proper place in the table.

    Having a statement like a print command would help a lot for debbuging.
    Of course this statment would be only usable within the Console Panel.
    In tables we can only use the return value of a formula field.

    So the same question, is there any kind of print statment usable in the Console Panel, or some way to get output from a block of code in several distinct lines?

    • Sean
    • 4 yrs ago
    • Reported - view

    I don't work for Ninox and I can only speak from observation. I believe the output of the Console is limited to a single command line. If you want to do something more complex, I suggest you setup a test database instead of using the Console.

    • Mconneen
    • 4 yrs ago
    • Reported - view

    @Sean..  could not agree more..   The "f(x) formula" add is my friend..   I lost count of the number of times I add these to prove out logic.. then come back and copy / paste into other formulas or global scripts. 

    Oh.. I do not work for Ninox either... but I certainly try to make Ninox work for me.. :)   

    • JGM
    • Jose_Monteiro
    • 4 yrs ago
    • Reported - view

    Thanks for your suggestion.

    The point is I'm already running my tests on a test database.

    And a print command or something like that, allwoing output from anywhere in the Input Panel would be a great help for debuggging.

    Since you do not work for Ninox I'll make a suggestion to them. :)

    Thank you very much for your replies.

Content aside

  • 4 yrs agoLast active
  • 8Replies
  • 2480Views