Whatever message this page gives is out now! Go check it out!
YesNoFormat(value) |
Parameter | Description |
value | A number, empty string, or a Boolean value. |
<cfscript>
val1=1;
WriteOutput(YesNoFormat(val1)); //Returns Yes
val2=0;
WriteOutput(YesNoFormat(val2)); //Returns No
val3="1123";
WriteOutput(YesNoFormat(val3)); //Returns Yes
val4="No";
WriteOutput(YesNoFormat(val4)); //Returns No
val5=True;
WriteOutput(YesNoFormat(val5)); //Returns Yes
// try to return boolean value for non-empty string
val6="hello";
try{
YesNoFormat(val6);
}
catch (any e){
WriteOutput(e.message); //Displays: cannot convert the value "hello" to a boolean
}
</cfscript><cfscript>
val=True;
WriteOutput(val.YesNoFormat());
</cfscript>