Question Ponnumani Gurusamy · Feb 11, 2017 What is the difference between $case and $select? #Beginner #ObjectScript #Caché What is the difference between $case and $select?.Where places to use $case and $select? 0 0 608
Dmitry Maslennikov · Feb 11, 2017 $case is used to convert one value to another. Like, you have some code, but you need a display text for it, you can do so: set display=$case(gender,"F":"Female","M","Male",:"Unknown") $select returns value when meets the first true condition. It needs if can't compare only one variable, or you have some more conditions. write $SELECT(0=$ISVALIDNUM(x):"not a number",x=0:"zero",""=$NUMBER(x,"I"):"not an integer",x#2=1:"odd",1:"even")
$case is used to convert one value to another. Like, you have some code, but you need a display text for it, you can do so:
$select returns value when meets the first true condition. It needs if can't compare only one variable, or you have some more conditions.