Groovy web console

subscribe to the feed Subscribe
to this
site

Successive conditions

Published 4 months ago by Valentin
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
c1 = "socrates" == "dog"
c2 = 13 + 2 == 15
c3 = true

if (c1) {
   f1()
} else if (c2) {
   f2()
} else if (c3) { 
   f3()
}

void f1(String name){ println "F1" }
void f2(String name){ println "F2" }
void f3(String name){ println "F3" }