0

if / then / else

if / then / else

can I add 4 strings like this ?

5 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Yes, but you could also use switch , e.g. :

    switch <expression> do
    case <value>: <result value>
    case <value2>: <result value2>
    ...
    default: <default value>
    end

     

    Steven.

    • madeconconsulting
    • 4 yrs ago
    • Reported - view

    If I use this, after the 2nd add, the result becomes 0 ...

    if 'Pratiche Svolte' = "1" then
    250
    else
    0
    end + if 'Pratiche Svolte' = "2" then
    250
    else
    0
    end + if 'Pratiche Svolte' = "3" then
    500
    else
    0
    end + if 'Pratiche Svolte' = "4" then
    1000
    else
    0
    end

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    switch 'Pratiche Svolte' do
    case "1" : 250
    case "2" : 250
    case "3" : 500
    case "4" : 1000
    default : 0
    end

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    or something like this to add:

    Vota := Vota + switch 'Pratiche Svolte' do
    case "1":
    250
    case "2":
    250
    case "3":
    500
    case "4":
    1000
    default:
    0
    end

    • madeconconsulting
    • 4 yrs ago
    • Reported - view

    Not working... same result..

    sorry, but thks for.

Content aside

  • 4 yrs agoLast active
  • 5Replies
  • 601Views