Determines the type of a value.
True, if value is a string, number, Boolean, or date/time value; False, otherwise.
IsSimpleValue(value)
Parameter |
Description |
|---|---|
value |
Variable or expression |
<cfscript>
string = "hello World";
num = 1;
resultString = IsSimpleValue(string);
resultNum = IsSimpleValue(num);
resultDate = IsSimpleValue(Now());
writeoutput("Is a string a simplevalue: " & resultString & "<br>");
writeoutput("Is a number a simplevalue: " & resultNum & "<br>");
writeoutput("Is a date/time a simplevalue: " & resultDate & "<br>");
</cfscript>
Output
Is a string a simplevalue: YES
Is a number a simplevalue: YES
Is a date/time a simplevalue: YES
<cfscript>
// Define a struct
s={
"a":1,
"b":2,
"c":3
}
// Define an array
a=[1,2,3,4,5]
// Struct is a complex value
writeOutput("Is struct a simple value: " & isSimpleValue(s) & "<br>")
// Array is also a complex value
writeOutput("Is array a simple value: " & isSimpleValue(a) & "<br>")
</cfscript>
Output
Is struct a simple value: NO
Is array a simple value: NO
Sign in to your account