IsSimpleValue

Description

Determines the type of a value.

Return value

True, if value is a string, number, Boolean, or date/time value; False, otherwise.

Category

Decision functions

Syntax

IsSimpleValue(value) 

Parameters

Parameter Description
value
Variable or expression

Example

<!--- Shows an example of IsQuery and IsSimpleValue --->
<h3>IsSimpleValue Example</h3>
<!--- define a variable called "getEmployees" --->
<cfparam name = "getEmployees" default = "#Now()#">

<p>Before the query is run, the value of GetEmployees is 
<cfoutput>#getEmployees#</cfoutput>

<cfif IsSimpleValue(getEmployees)>
  <p>getEmployees is currently a simple value
</cfif>
<!--- make a query on the snippets datasource --->
<cfquery name = "getEmployees" datasource = "cfsnippets">
SELECT *
FROM employees
</cfquery> 
<p>After the query is run, GetEmployees contains a number of rows 
that look like this (display limited to three rows):
<cfoutput QUERY = "GetEmployees" MaxRows = "3">
<pre>#Emp_ID# #FirstName# #LastName#</pre>
</cfoutput>

<cfif IsQuery(getEmployees)>
  GetEmployees is no longer a simple value, but the name of a query
</cfif>

Comments