iif function

Bob Sneidar bobsneidar at iotecdigital.com
Fri Jan 24 13:37:00 EST 2020


Not sure if I ever posted this before (might be in the Master Library) but it is a very simple function for nesting if statements in a single line command pretty much like the old dBase or Excel function. Enjoy:

function iif pCondition, pstatement1, pStatement2
   -- ex. iif(a=b, true, iif(a=c,true, false))
   if pCondition then
      return value(pstatement1)
   else
      return value(pStatement2)
   end if
end iif

Bob S



More information about the use-livecode mailing list