| STRUCTFIND | |
| 説明
構造体内のキーに関連付けられている値を調べます。 |
|
| 戻り値
構造体内のキーに関連付けられている値。structure が存在しない場合は例外が発生します。 |
|
| カテゴリ
構造体関数 |
|
関数のシンタックスStructFind(structure, key) |
|
| 関連項目
構造体関数、『ColdFusion MX 開発ガイド』の第5章の「配列と構造体の使用」 の「構造体関数」 |
|
| パラメータ
|
|
| 使用方法
構造体のキーはソートされていません。 |
|
例<!--- この例は参照のみで、StructFind の使用方法を示しています。 --->
<p>このファイルは、StructNew、StructClear、および StructDelete で呼び出される
addemployee.cfm と同じです。この中では、従業員の追加を行っています。従業員の情報は employee 構造体
(EMPINFO 属性) から渡されます。UNIX では、Emp_ID も追加する必要があります。
<!---
<cfswitch expression = "#ThisTag.ExecutionMode#">
<cfcase value = "start">
<cfif StructIsEmpty(attributes.EMPINFO)>
<cfoutput>エラー。従業員データが渡されていません。</cfoutput>
<cfexit method = "ExitTag">
<cfelse>
<cfquery name = "AddEmployee" datasource = "cfdocexamples">
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> --->
|
|
| STRUCTURE | |
| 調べる値が含まれている構造体です。 | |
| KEY | |
| キーです。これに対応する値が返されます。 | |