If you mean a checkbox with True/False/Null: it's a widget option...
Ah...what I usually use as IIF(condition, value1, value2).
You can build a function by yourself, putting it into SYSTEM_LIBRARY:
entry iifreturns stringparams string pCond : IN string pOne : IN string pTwo : INendparamsif (pCond = "") return("")if ($condition(pCond) | $uppercase($rtrim($ltrim(pCond, " "), " ")) = "TRUE") return(pOne)else return(pTwo)endifend
Take care to read about $condition into Uniface manuals.
I hope it could help you.
Happy to have helped you!
BTW...a real ternary operator would have a larger perimeter! The user defined function I've provided accept only strings while a real ternary operator would accept any data type for value1 and value2 (numbers, dates, ...).
IMHO the request for a real ternary operator remains a nice to have wish.
77 4th AvenueWaltham, MA 02451 USA
Rocket Support Community
All Support Offerings
About Rocket Software
Training and Services
Forum Terms and Conditions
Contact Forum Moderator