0

Reference of Functions and Language

Hi,

I understood the use of the select statement, but I need a confirmation, please...

1.
I can use the select statement with a not linked table too, from any table in the DB?
2.
The select statement run with data fields only, or with formula fields too?
3.
I have three tables; Table A, linked to Table B; Table B linked to Table C; I can use the select statement from the Table A to obtain the Table C data (the Tables A and C are not directed linked); is it correct?
4.
Can I receive a lot of example with a little DB, to understand better the "How to do", please?

Thanks for all
Best regards
Roberto

106 replies

null
    • Leonid_Semik
    • 7 yrs ago
    • Reported - view
    Hi Jeni,

    if 'Accepted' != null then ........

    regards
    Leo
    • jenireid28
    • 7 yrs ago
    • Reported - view
    Thanks :-)
    • jenireid28
    • 7 yrs ago
    • Reported - view
    Hello - sorry, me again. I would like a new record to be created in a table when a box is checked on another table, and then that new record to be opened so you can complete the other fields. Is that possible? So, if someone ticks a box on the "interview" form, a new "placement" record opens which is linked to the interview (so pulls across the name and client details). I can send you the database if that helps?
    • Birger_H
    • 7 yrs ago
    • Reported - view
    If you could send me (support@ninoxdb.de) a copy of the Ninox database you are working on (Main menu -> "Save Archvie as...") I'm sure that I can find a solution to your problem.

    Birger - Ninox Support
    • jenireid28
    • 7 yrs ago
    • Reported - view
    Thanks Birger I have just sent it.
    • kesterwatters2
    • 7 yrs ago
    • Reported - view
    Hi...I posted a couple of questions a few days ago and only now am able to log back in. How do I find them and see if they have been answered?
    • Birger_H
    • 7 yrs ago
    • Reported - view
    Find your comment (and the answers) here:
    http://manual.ninoxdb.de/en/formulas-and-calculations/
    • kesterwatters2
    • 7 yrs ago
    • Reported - view
    Thanks Birger. Is there some way in general to find comments and answers that I post...even if several days have gone by?
    • Birger_H
    • 7 yrs ago
    • Reported - view
    Well - I don't know :-) Aren't there email notifications?

    Birger - Ninox Support
    • Tim
    • 7 yrs ago
    • Reported - view
    Hi. I want to loop through some records, and detect when some value is different from the previous record.

    In this example, I just loop through an array of numbers, trying to detect when a number isn't the same as the previous:

    let prev := 0;
    "start";
    for a in [1, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6] do
    if a = prev then
    "same"
    else
    (let prev := a;
    "different")
    end

    The result is:

    "different,different,different,different,different,different,different,different,different,different,different,different"

    It looks to me like the 'prev' variable must have a local scope inside the loop.

    How can I get the 'prev' inside the for loop to be the same scope as the 'prev' outside the loop?

    Thank you for your help!

    (Tim)
    • Birger_H
    • 6 yrs ago
    • Reported - view
    Try it like this:
    –––
    var prev := 0;
    "start";
    for a in [1, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6] do
    if a = prev then
    (prev := a;
    "same")
    else
    (prev := a;
    "different")
    end
    –––


    Birger - Ninox Support
    • Tim
    • 6 yrs ago
    • Reported - view
    That works! Thank you!

    Can you explain the difference between "var" and "let"?

    Also, can you explain when and why to leave out "var" or "let", as in line 5 and 8 in your example?

    Thanks again!

    (Tim)
    • Frank_Bohmer
    • 6 yrs ago
    • Reported - view
    var is for variables, let for constants (though, due to a bug in the most recent version, also let-values can be changed).
    The first var declares the variable, the second assignment leaves out the var, since it has already been declared.
    • Tim
    • 6 yrs ago
    • Reported - view
    Ah, yes. For declarations, like in Swift.

    So it wasn't a scoping problem, it was that I was getting a new variable declaration (of the same name) every time.

    Thanks!
    • kesterwatters2
    • 6 yrs ago
    • Reported - view
    Nope...I have to keep a log of questions that I post and then check to see if there is a response. I also have to keep track of where...which section of the manual... I post things or I lose track of them.
    • Tim
    • 6 yrs ago
    • Reported - view
    Hi, again. I'm really having fun with the scripting features of Ninox!

    I found the list of new features in Ninox 2.2.0 and would like to know more about the new loop features, especially the 'while' loop. Is that covered in the documentation somewhere or can you provide a couple of examples here?

    Thanks!

    (Tim)
    • Tim
    • 6 yrs ago
    • Reported - view
    A question about user-defined functions:

    How can I pass a record as an argument?

    -- Start example

    function myfunc(somerecord: ) do
    somerecord.somefield := "some value"
    end

    myfunc(first(select sometable))

    -- End example

    Thanks!

    (Tim)
    • Tim
    • 6 yrs ago
    • Reported - view
    Sorry, I messed up my example a little.

    The question is how do I specify the argument type when I want to pass a record to the function?
    • Birger_H
    • 6 yrs ago
    • Reported - view
    Try it like this:
    –––
    function hello(name: text) do
    "Hello " + name + "!"
    end
    –––

    Possible values are "text", "number", "boolean", "date", "datetime"

    Birger - Ninox Support
    • Tim
    • 6 yrs ago
    • Reported - view
    Ah. So I can't pass a record as an argument to a function. I hope that is on a list of future enhancements.

    Thank you for the information.

    (Tim)
    • foghorn
    • 6 yrs ago
    • Reported - view
    Hi Birger,

    Did you happen to find a solution for Jeni's request? I would also like to do the same thing.

    I need to be able to pick multiple sizes from a multiple choice field which then creates a new record for each selection (size) in my "Cost table" which is referenced.

    Thanks
    • Birger_H
    • 6 yrs ago
    • Reported - view
    Have a look at this template.


    Birger - Ninox Support
    • Robert
    • 6 yrs ago
    • Reported - view
    Hi,

    How can we display a "Are you sure?" popup before deleting a record?

    Thanks for a great product!
    Rob
    • Leonid_Semik
    • 6 yrs ago
    • Reported - view
    The popup alert function does not allow transactions after clicking OK.
    You can write a ' quasi alert '

    https://www.dropbox.com/s/hztqiuo8lrg19x2/Deleting.ninox?dl=0

    regards
    Leo
    • Alexander_Koenig
    • 6 yrs ago
    • Reported - view
    Hi Rob,

    we put this feature to confirm deletion on the change request list.

    Best regards,

    Alex

Content aside

  • 6 yrs agoLast active
  • 106Replies
  • 35931Views