CalcBuilder Forum

run 2 ot more code

Usuario zen11t 2018-01-09 18:41:55

Hi!

How can I make that user choose e.g. a country and run a specific code, but when choose an another then calc use another code?

Thanks for the help,
Zen11t

Edited by zen11t - 09.01.2018 18:42

Moonsoft support 2018-01-09 18:46:45

Hi,
you can introduce conditional expressions at your code, let's say your field variable is
country

and you have different values at your option 'value' field, for ex

USA
Germany
Spain

at the code you can run different calculations using 'if' structure:

if($country=="USA"){

//this section of code will only be used if country=USA

}
if($country=="Spain"){

//this section of code will only be used if country=Spain

}

..etc

Hope this helps, regards

Usuario zen11t 2018-01-11 17:56:14

Thank you very much.

Zen11t

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!