ColdFusion MX
目 次 > CFML リファレンス > ColdFusion 関数 > IsStruct O

IsStruct

変数が構造体かどうかを調べます。

変数 (variable) が ColdFusion 構造体または java.lang.Map インターフェースを実装する Java オブジェクトの場合は true、数 (variable) 内のオブジェクトがユーザー定義関数 (UDF) である場合は false

決定関数構造体関数

IsStruct(variable)

構造体関数

ColdFusion MX: 動作が変更されました。この関数は、XML オブジェクトに使用できます。

パラメータ

説明

variable

変数名

<!--- この参照専用の例は、IsStruct の使用方法を示しています。--- --->
<p>このファイルは、StructNew、StructClear、および StructDelete で呼び出される addemployee.cfm に類似しています。このファイルは従業員の追加に使用されるカスタムタグの例です。従業員の情報は employee 構造体 (EMPINFO 属性) から渡されます。UNIX では、Emp_ID も追加する必要があります。
<!--- 
<cfswitch expression = "#ThisTag.ExecutionMode#">
  <cfcase value = "start">
   <cfif IsStruct(attributes.EMPINFO)>
   <cfoutput>Error.Invalid data.</cfoutput>
   <cfexit method = "ExitTag">
   <cfelse>
   <cfquery name = "AddEmployee" datasource = "cfsnippets">
   INSERT INTO Employees
   (FirstName, LastName, Email, Phone, Department)
   VALUES
   <cfoutput>
   (
   '#StructFind(attributes.EMPINFO, "firstname")#' ,
   '#StructFind(attributes.EMPINFO, "lastname")#' ,
   '#StructFind(attributes.EMPINFO, "email")#' ,
   '#StructFind(attributes.EMPINFO, "phone")#' ,
   '#StructFind(attributes.EMPINFO, "department")#'
   )
   </cfoutput> 
   </cfquery>
</cfif>
<cfoutput><hr>従業員情報の追加が完了しました。</cfoutput>
</cfcase>
</cfswitch> --->

目 次 > CFML リファレンス > ColdFusion 関数 > IsStruct O